netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] Expose rtnl_link_ops_get()
       [not found] ` <1263999673-11279-1-git-send-email-danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
@ 2010-01-20 15:01   ` Dan Smith
  2010-01-20 15:01   ` [PATCH 2/3] Add a veth_get_peer() and veth_set_peer() functions Dan Smith
  1 sibling, 0 replies; 4+ messages in thread
From: Dan Smith @ 2010-01-20 15:01 UTC (permalink / raw)
  To: containers-qjLDD68F18O7TbgM5vRIOg; +Cc: netdev-u79uwXL29TY76Z2rM5mHXA

Signed-off-by: Dan Smith <danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
Cc: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
---
 include/net/rtnetlink.h |    1 +
 net/core/rtnetlink.c    |    2 +-
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/include/net/rtnetlink.h b/include/net/rtnetlink.h
index c3aa044..a165769 100644
--- a/include/net/rtnetlink.h
+++ b/include/net/rtnetlink.h
@@ -82,6 +82,7 @@ extern void	rtnl_kill_links(struct net *net, struct rtnl_link_ops *ops);
 extern int	rtnl_link_register(struct rtnl_link_ops *ops);
 extern void	rtnl_link_unregister(struct rtnl_link_ops *ops);
 
+extern const struct rtnl_link_ops *rtnl_link_ops_get(const char *kind);
 extern struct net_device *rtnl_create_link(struct net *net, char *ifname,
 		const struct rtnl_link_ops *ops, struct nlattr *tb[]);
 extern const struct nla_policy ifla_policy[IFLA_MAX+1];
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index eb42873..2b2150c 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -325,7 +325,7 @@ void rtnl_link_unregister(struct rtnl_link_ops *ops)
 
 EXPORT_SYMBOL_GPL(rtnl_link_unregister);
 
-static const struct rtnl_link_ops *rtnl_link_ops_get(const char *kind)
+const struct rtnl_link_ops *rtnl_link_ops_get(const char *kind)
 {
 	const struct rtnl_link_ops *ops;
 
-- 
1.6.2.5

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

* [PATCH 2/3] Add a veth_get_peer() and veth_set_peer() functions
       [not found] ` <1263999673-11279-1-git-send-email-danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
  2010-01-20 15:01   ` [PATCH 1/3] Expose rtnl_link_ops_get() Dan Smith
@ 2010-01-20 15:01   ` Dan Smith
  2010-01-21  9:24     ` David Miller
  1 sibling, 1 reply; 4+ messages in thread
From: Dan Smith @ 2010-01-20 15:01 UTC (permalink / raw)
  To: containers-qjLDD68F18O7TbgM5vRIOg; +Cc: netdev-u79uwXL29TY76Z2rM5mHXA

This is needed for C/R.  For checkpoint, we need to be able to follow
the link from one veth device to its peer.  For restart, we need to be
able to link two veth devices we've restored to re-establish their
relationship.

Signed-off-by: Dan Smith <danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
Cc: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
---
 drivers/net/veth.c   |   14 ++++++++++++++
 include/linux/veth.h |    5 +++++
 2 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/drivers/net/veth.c b/drivers/net/veth.c
index ade5b34..eb47080 100644
--- a/drivers/net/veth.c
+++ b/drivers/net/veth.c
@@ -454,6 +454,20 @@ static void veth_dellink(struct net_device *dev)
 	unregister_netdevice(peer);
 }
 
+struct net_device *veth_get_peer(struct net_device *veth)
+{
+	struct veth_priv *priv = netdev_priv(veth);
+
+	return priv->peer;
+}
+
+void veth_set_peer(struct net_device *veth, struct net_device *peer)
+{
+	struct veth_priv *priv = netdev_priv(veth);
+
+	priv->peer = peer;
+}
+
 static const struct nla_policy veth_policy[VETH_INFO_MAX + 1];
 
 static struct rtnl_link_ops veth_link_ops = {
diff --git a/include/linux/veth.h b/include/linux/veth.h
index 3354c1e..eee059d 100644
--- a/include/linux/veth.h
+++ b/include/linux/veth.h
@@ -9,4 +9,9 @@ enum {
 #define VETH_INFO_MAX	(__VETH_INFO_MAX - 1)
 };
 
+#ifdef __KERNEL__
+struct net_device *veth_get_peer(struct net_device *veth);
+void veth_set_peer(struct net_device *veth, struct net_device *peer);
+#endif
+
 #endif
-- 
1.6.2.5

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

* Re: [PATCH 2/3] Add a veth_get_peer() and veth_set_peer() functions
  2010-01-20 15:01   ` [PATCH 2/3] Add a veth_get_peer() and veth_set_peer() functions Dan Smith
@ 2010-01-21  9:24     ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2010-01-21  9:24 UTC (permalink / raw)
  To: danms; +Cc: containers, orenl, netdev


If you're going to CC: netdev on your first two patches
that expose infrastructure, you should CC: us on the
third patch too so we can see how in the world you're
using this stuff.

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

* [PATCH 2/3] Add a veth_get_peer() and veth_set_peer() functions
  2010-01-22 21:09 C/R: Network namespace and device support (v2) Dan Smith
@ 2010-01-22 21:09 ` Dan Smith
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Smith @ 2010-01-22 21:09 UTC (permalink / raw)
  To: containers; +Cc: netdev, orenl

This is needed for C/R.  For checkpoint, we need to be able to follow
the link from one veth device to its peer.  For restart, we need to be
able to link two veth devices we've restored to re-establish their
relationship.

Signed-off-by: Dan Smith <danms@us.ibm.com>
Cc: netdev@vger.kernel.org
---
 drivers/net/veth.c   |   14 ++++++++++++++
 include/linux/veth.h |    5 +++++
 2 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/drivers/net/veth.c b/drivers/net/veth.c
index ade5b34..eb47080 100644
--- a/drivers/net/veth.c
+++ b/drivers/net/veth.c
@@ -454,6 +454,20 @@ static void veth_dellink(struct net_device *dev)
 	unregister_netdevice(peer);
 }
 
+struct net_device *veth_get_peer(struct net_device *veth)
+{
+	struct veth_priv *priv = netdev_priv(veth);
+
+	return priv->peer;
+}
+
+void veth_set_peer(struct net_device *veth, struct net_device *peer)
+{
+	struct veth_priv *priv = netdev_priv(veth);
+
+	priv->peer = peer;
+}
+
 static const struct nla_policy veth_policy[VETH_INFO_MAX + 1];
 
 static struct rtnl_link_ops veth_link_ops = {
diff --git a/include/linux/veth.h b/include/linux/veth.h
index 3354c1e..eee059d 100644
--- a/include/linux/veth.h
+++ b/include/linux/veth.h
@@ -9,4 +9,9 @@ enum {
 #define VETH_INFO_MAX	(__VETH_INFO_MAX - 1)
 };
 
+#ifdef __KERNEL__
+struct net_device *veth_get_peer(struct net_device *veth);
+void veth_set_peer(struct net_device *veth, struct net_device *peer);
+#endif
+
 #endif
-- 
1.6.2.5


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

end of thread, other threads:[~2010-01-22 21:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1263999673-11279-1-git-send-email-danms@us.ibm.com>
     [not found] ` <1263999673-11279-1-git-send-email-danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2010-01-20 15:01   ` [PATCH 1/3] Expose rtnl_link_ops_get() Dan Smith
2010-01-20 15:01   ` [PATCH 2/3] Add a veth_get_peer() and veth_set_peer() functions Dan Smith
2010-01-21  9:24     ` David Miller
2010-01-22 21:09 C/R: Network namespace and device support (v2) Dan Smith
2010-01-22 21:09 ` [PATCH 2/3] Add a veth_get_peer() and veth_set_peer() functions Dan Smith

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).