Tue, Oct 20, 2015 at 09:36:38PM CEST, [email protected] wrote:
>From: Scott Feldman <[email protected]>
>
>Fixes: 0bc05d585d ("switchdev: allow caller to explicitly request attr_set as 
>deferred")

This "fixes" is wrong. Should be:
4d429c5ddc5128fccd3048059ae26bb39f0d8284
"switchdev: introduce possibility to defer obj_add/del"


>Signed-off-by: Scott Feldman <[email protected]>
>---
> net/switchdev/switchdev.c |   19 ++++++++++++++++++-
> 1 file changed, 18 insertions(+), 1 deletion(-)
>
>diff --git a/net/switchdev/switchdev.c b/net/switchdev/switchdev.c
>index 56d8479..be8ced1 100644
>--- a/net/switchdev/switchdev.c
>+++ b/net/switchdev/switchdev.c
>@@ -489,7 +489,24 @@ static void switchdev_port_obj_del_deferred(struct 
>net_device *dev,
> static int switchdev_port_obj_del_defer(struct net_device *dev,
>                                       const struct switchdev_obj *obj)
> {
>-      return switchdev_deferred_enqueue(dev, obj, sizeof(*obj),
>+      size_t size = 0;
>+
>+      switch (obj->id) {
>+      case SWITCHDEV_OBJ_ID_PORT_VLAN:
>+              size = sizeof(struct switchdev_obj_port_vlan);
>+              break;
>+      case SWITCHDEV_OBJ_ID_IPV4_FIB:
>+              size = sizeof(struct switchdev_obj_ipv4_fib);
>+              break;
>+      case SWITCHDEV_OBJ_ID_PORT_FDB:
>+              size = sizeof(struct switchdev_obj_port_fdb);
>+              break;
>+      default:
>+              WARN_ON(!size);
>+              return -EINVAL;
>+      }
>+
>+      return switchdev_deferred_enqueue(dev, obj, size,
>                                         switchdev_port_obj_del_deferred);

we need this for add as well. Perhaps some generic helper to get size of
obj?


> }
> 
>-- 
>1.7.10.4
>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to