* [patch net-next] openvswitch:: link upper device for port devices
@ 2013-07-26 12:01 Jiri Pirko
2013-07-30 7:07 ` David Miller
2013-07-30 23:11 ` Jesse Gross
0 siblings, 2 replies; 3+ messages in thread
From: Jiri Pirko @ 2013-07-26 12:01 UTC (permalink / raw)
To: netdev; +Cc: davem, jesse, dev
Link upper device properly. That will make IFLA_MASTER filled up.
Set the master to port 0 of the datapath under which the port belongs.
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
---
net/openvswitch/vport-netdev.c | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
diff --git a/net/openvswitch/vport-netdev.c b/net/openvswitch/vport-netdev.c
index 5982f3f..09d93c1 100644
--- a/net/openvswitch/vport-netdev.c
+++ b/net/openvswitch/vport-netdev.c
@@ -25,6 +25,7 @@
#include <linux/llc.h>
#include <linux/rtnetlink.h>
#include <linux/skbuff.h>
+#include <linux/openvswitch.h>
#include <net/llc.h>
@@ -74,6 +75,15 @@ static rx_handler_result_t netdev_frame_hook(struct sk_buff **pskb)
return RX_HANDLER_CONSUMED;
}
+static struct net_device *get_dpdev(struct datapath *dp)
+{
+ struct vport *local;
+
+ local = ovs_vport_ovsl(dp, OVSP_LOCAL);
+ BUG_ON(!local);
+ return netdev_vport_priv(local)->dev;
+}
+
static struct vport *netdev_create(const struct vport_parms *parms)
{
struct vport *vport;
@@ -103,10 +113,15 @@ static struct vport *netdev_create(const struct vport_parms *parms)
}
rtnl_lock();
+ err = netdev_master_upper_dev_link(netdev_vport->dev,
+ get_dpdev(vport->dp));
+ if (err)
+ goto error_unlock;
+
err = netdev_rx_handler_register(netdev_vport->dev, netdev_frame_hook,
vport);
if (err)
- goto error_unlock;
+ goto error_master_upper_dev_unlink;
dev_set_promiscuity(netdev_vport->dev, 1);
netdev_vport->dev->priv_flags |= IFF_OVS_DATAPATH;
@@ -114,6 +129,8 @@ static struct vport *netdev_create(const struct vport_parms *parms)
return vport;
+error_master_upper_dev_unlink:
+ netdev_upper_dev_unlink(netdev_vport->dev, get_dpdev(vport->dp));
error_unlock:
rtnl_unlock();
error_put:
@@ -140,6 +157,7 @@ static void netdev_destroy(struct vport *vport)
rtnl_lock();
netdev_vport->dev->priv_flags &= ~IFF_OVS_DATAPATH;
netdev_rx_handler_unregister(netdev_vport->dev);
+ netdev_upper_dev_unlink(netdev_vport->dev, get_dpdev(vport->dp));
dev_set_promiscuity(netdev_vport->dev, -1);
rtnl_unlock();
--
1.8.1.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [patch net-next] openvswitch:: link upper device for port devices
2013-07-26 12:01 [patch net-next] openvswitch:: link upper device for port devices Jiri Pirko
@ 2013-07-30 7:07 ` David Miller
2013-07-30 23:11 ` Jesse Gross
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2013-07-30 7:07 UTC (permalink / raw)
To: jiri; +Cc: netdev, jesse, dev
From: Jiri Pirko <jiri@resnulli.us>
Date: Fri, 26 Jul 2013 14:01:54 +0200
> Link upper device properly. That will make IFLA_MASTER filled up.
> Set the master to port 0 of the datapath under which the port belongs.
>
> Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Jesse you got this?
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [patch net-next] openvswitch:: link upper device for port devices
2013-07-26 12:01 [patch net-next] openvswitch:: link upper device for port devices Jiri Pirko
2013-07-30 7:07 ` David Miller
@ 2013-07-30 23:11 ` Jesse Gross
1 sibling, 0 replies; 3+ messages in thread
From: Jesse Gross @ 2013-07-30 23:11 UTC (permalink / raw)
To: Jiri Pirko; +Cc: netdev, David Miller, dev
On Fri, Jul 26, 2013 at 5:01 AM, Jiri Pirko <jiri@resnulli.us> wrote:
> Link upper device properly. That will make IFLA_MASTER filled up.
> Set the master to port 0 of the datapath under which the port belongs.
>
> Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Applied, thanks.
Sorry about the delay - I was waiting to see if the vxlan stuff would wrap up.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-07-30 23:12 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-26 12:01 [patch net-next] openvswitch:: link upper device for port devices Jiri Pirko
2013-07-30 7:07 ` David Miller
2013-07-30 23:11 ` Jesse Gross
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).