[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1444117913-10386-9-git-send-email-jiri@resnulli.us>
Date: Tue, 6 Oct 2015 09:51:47 +0200
From: Jiri Pirko <jiri@...nulli.us>
To: netdev@...r.kernel.org
Cc: davem@...emloft.net, sfeldma@...il.com, idosch@...lanox.com,
eladr@...lanox.com, tgraf@...g.ch, ast@...mgrid.com,
David.Laight@...LAB.COM, john.fastabend@...il.com
Subject: [patch net-next v3 08/14] rocker: set default world on port probe and clean world on remove
From: Jiri Pirko <jiri@...lanox.com>
Currently, there is only OF-DPA world supported in HW. So make this
would the default one for newly created rocker ports.
Signed-off-by: Jiri Pirko <jiri@...lanox.com>
---
v1->v2:
- s/__rocker_port_change_world/rocker_port_change_world/
---
drivers/net/ethernet/rocker/rocker_main.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/net/ethernet/rocker/rocker_main.c b/drivers/net/ethernet/rocker/rocker_main.c
index 55e8ed6..10fa7df 100644
--- a/drivers/net/ethernet/rocker/rocker_main.c
+++ b/drivers/net/ethernet/rocker/rocker_main.c
@@ -2175,6 +2175,7 @@ static struct rocker_world_ops *rocker_world_ops[] = {
};
#define ROCKER_WORLD_OPS_LEN ARRAY_SIZE(rocker_world_ops)
+#define ROCKER_DEFAULT_WORLD_OPS rocker_world_ops[0]
struct rocker_world {
struct list_head list;
@@ -5198,6 +5199,7 @@ static void rocker_remove_ports(const struct rocker *rocker)
continue;
rocker_port_ig_tbl(rocker_port, NULL, ROCKER_OP_FLAG_REMOVE);
unregister_netdev(rocker_port->dev);
+ rocker_port_change_world(rocker_port, NULL);
free_netdev(rocker_port->dev);
}
kfree(rocker->ports);
@@ -5248,6 +5250,12 @@ static int rocker_probe_port(struct rocker *rocker, unsigned int port_number)
dev->features |= NETIF_F_NETNS_LOCAL | NETIF_F_SG;
+ err = rocker_port_change_world(rocker_port, ROCKER_DEFAULT_WORLD_OPS);
+ if (err) {
+ dev_err(&pdev->dev, "failed to set default world\n");
+ goto err_port_change_world;
+ }
+
err = register_netdev(dev);
if (err) {
dev_err(&pdev->dev, "register_netdev failed\n");
@@ -5282,6 +5290,8 @@ err_port_ig_tbl:
rocker->ports[port_number] = NULL;
unregister_netdev(dev);
err_register_netdev:
+ rocker_port_change_world(rocker_port, NULL);
+err_port_change_world:
free_netdev(dev);
return err;
}
--
1.9.3
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists