All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] xen-netback: add reference from xenvif to backend_info to facilitate coredump analysis
@ 2019-04-12  6:53 ` Dongli Zhang
  0 siblings, 0 replies; 9+ messages in thread
From: Dongli Zhang @ 2019-04-12  6:53 UTC (permalink / raw)
  To: xen-devel, netdev
  Cc: linux-kernel, wei.liu2, paul.durrant, davem, joe.jin, junxiao.bi,
	jie.l.li

During coredump analysis, it is not easy to obtain the address of
backend_info in xen-netback.

So far there are two ways to obtain backend_info:

1. Do what xenbus_device_find() does for vmcore to find the xenbus_device
and then derive it from dev_get_drvdata().

2. Extract backend_info from callstack of xenwatch (e.g., netback_remove()
or frontend_changed()).

This patch adds a reference from xenvif to backend_info so that it would be
much more easier to obtain backend_info during coredump analysis.

Signed-off-by: Dongli Zhang <dongli.zhang@oracle.com>
---
 drivers/net/xen-netback/common.h | 18 ++++++++++++++++++
 drivers/net/xen-netback/xenbus.c | 17 +----------------
 2 files changed, 19 insertions(+), 16 deletions(-)

diff --git a/drivers/net/xen-netback/common.h b/drivers/net/xen-netback/common.h
index 936c0b3..05847eb 100644
--- a/drivers/net/xen-netback/common.h
+++ b/drivers/net/xen-netback/common.h
@@ -248,6 +248,22 @@ struct xenvif_hash {
 	struct xenvif_hash_cache cache;
 };
 
+struct backend_info {
+	struct xenbus_device *dev;
+	struct xenvif *vif;
+
+	/* This is the state that will be reflected in xenstore when any
+	 * active hotplug script completes.
+	 */
+	enum xenbus_state state;
+
+	enum xenbus_state frontend_state;
+	struct xenbus_watch hotplug_status_watch;
+	u8 have_hotplug_status_watch:1;
+
+	const char *hotplug_script;
+};
+
 struct xenvif {
 	/* Unique identifier for this interface. */
 	domid_t          domid;
@@ -283,6 +299,8 @@ struct xenvif {
 	struct xenbus_watch credit_watch;
 	struct xenbus_watch mcast_ctrl_watch;
 
+	struct backend_info *be;
+
 	spinlock_t lock;
 
 #ifdef CONFIG_DEBUG_FS
diff --git a/drivers/net/xen-netback/xenbus.c b/drivers/net/xen-netback/xenbus.c
index 330ddb6..41c9e8f 100644
--- a/drivers/net/xen-netback/xenbus.c
+++ b/drivers/net/xen-netback/xenbus.c
@@ -22,22 +22,6 @@
 #include <linux/vmalloc.h>
 #include <linux/rtnetlink.h>
 
-struct backend_info {
-	struct xenbus_device *dev;
-	struct xenvif *vif;
-
-	/* This is the state that will be reflected in xenstore when any
-	 * active hotplug script completes.
-	 */
-	enum xenbus_state state;
-
-	enum xenbus_state frontend_state;
-	struct xenbus_watch hotplug_status_watch;
-	u8 have_hotplug_status_watch:1;
-
-	const char *hotplug_script;
-};
-
 static int connect_data_rings(struct backend_info *be,
 			      struct xenvif_queue *queue);
 static void connect(struct backend_info *be);
@@ -472,6 +456,7 @@ static int backend_create_xenvif(struct backend_info *be)
 		return err;
 	}
 	be->vif = vif;
+	vif->be = be;
 
 	kobject_uevent(&dev->dev.kobj, KOBJ_ONLINE);
 	return 0;
-- 
2.7.4


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

* [Xen-devel] [PATCH 1/1] xen-netback: add reference from xenvif to backend_info to facilitate coredump analysis
@ 2019-04-12  6:53 ` Dongli Zhang
  0 siblings, 0 replies; 9+ messages in thread
From: Dongli Zhang @ 2019-04-12  6:53 UTC (permalink / raw)
  To: xen-devel, netdev
  Cc: wei.liu2, joe.jin, linux-kernel, junxiao.bi, paul.durrant,
	jie.l.li, davem

During coredump analysis, it is not easy to obtain the address of
backend_info in xen-netback.

So far there are two ways to obtain backend_info:

1. Do what xenbus_device_find() does for vmcore to find the xenbus_device
and then derive it from dev_get_drvdata().

2. Extract backend_info from callstack of xenwatch (e.g., netback_remove()
or frontend_changed()).

This patch adds a reference from xenvif to backend_info so that it would be
much more easier to obtain backend_info during coredump analysis.

Signed-off-by: Dongli Zhang <dongli.zhang@oracle.com>
---
 drivers/net/xen-netback/common.h | 18 ++++++++++++++++++
 drivers/net/xen-netback/xenbus.c | 17 +----------------
 2 files changed, 19 insertions(+), 16 deletions(-)

diff --git a/drivers/net/xen-netback/common.h b/drivers/net/xen-netback/common.h
index 936c0b3..05847eb 100644
--- a/drivers/net/xen-netback/common.h
+++ b/drivers/net/xen-netback/common.h
@@ -248,6 +248,22 @@ struct xenvif_hash {
 	struct xenvif_hash_cache cache;
 };
 
+struct backend_info {
+	struct xenbus_device *dev;
+	struct xenvif *vif;
+
+	/* This is the state that will be reflected in xenstore when any
+	 * active hotplug script completes.
+	 */
+	enum xenbus_state state;
+
+	enum xenbus_state frontend_state;
+	struct xenbus_watch hotplug_status_watch;
+	u8 have_hotplug_status_watch:1;
+
+	const char *hotplug_script;
+};
+
 struct xenvif {
 	/* Unique identifier for this interface. */
 	domid_t          domid;
@@ -283,6 +299,8 @@ struct xenvif {
 	struct xenbus_watch credit_watch;
 	struct xenbus_watch mcast_ctrl_watch;
 
+	struct backend_info *be;
+
 	spinlock_t lock;
 
 #ifdef CONFIG_DEBUG_FS
diff --git a/drivers/net/xen-netback/xenbus.c b/drivers/net/xen-netback/xenbus.c
index 330ddb6..41c9e8f 100644
--- a/drivers/net/xen-netback/xenbus.c
+++ b/drivers/net/xen-netback/xenbus.c
@@ -22,22 +22,6 @@
 #include <linux/vmalloc.h>
 #include <linux/rtnetlink.h>
 
-struct backend_info {
-	struct xenbus_device *dev;
-	struct xenvif *vif;
-
-	/* This is the state that will be reflected in xenstore when any
-	 * active hotplug script completes.
-	 */
-	enum xenbus_state state;
-
-	enum xenbus_state frontend_state;
-	struct xenbus_watch hotplug_status_watch;
-	u8 have_hotplug_status_watch:1;
-
-	const char *hotplug_script;
-};
-
 static int connect_data_rings(struct backend_info *be,
 			      struct xenvif_queue *queue);
 static void connect(struct backend_info *be);
@@ -472,6 +456,7 @@ static int backend_create_xenvif(struct backend_info *be)
 		return err;
 	}
 	be->vif = vif;
+	vif->be = be;
 
 	kobject_uevent(&dev->dev.kobj, KOBJ_ONLINE);
 	return 0;
-- 
2.7.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* Re: [PATCH 1/1] xen-netback: add reference from xenvif to backend_info to facilitate coredump analysis
  2019-04-12  6:53 ` [Xen-devel] " Dongli Zhang
@ 2019-04-12 14:28   ` Wei Liu
  -1 siblings, 0 replies; 9+ messages in thread
From: Wei Liu @ 2019-04-12 14:28 UTC (permalink / raw)
  To: Dongli Zhang
  Cc: xen-devel, netdev, linux-kernel, wei.liu2, paul.durrant, davem,
	joe.jin, junxiao.bi, jie.l.li

On Fri, Apr 12, 2019 at 02:53:24PM +0800, Dongli Zhang wrote:
> During coredump analysis, it is not easy to obtain the address of
> backend_info in xen-netback.
> 
> So far there are two ways to obtain backend_info:
> 
> 1. Do what xenbus_device_find() does for vmcore to find the xenbus_device
> and then derive it from dev_get_drvdata().
> 
> 2. Extract backend_info from callstack of xenwatch (e.g., netback_remove()
> or frontend_changed()).
> 
> This patch adds a reference from xenvif to backend_info so that it would be
> much more easier to obtain backend_info during coredump analysis.
> 
> Signed-off-by: Dongli Zhang <dongli.zhang@oracle.com>

Acked-by: Wei Liu <wei.liu2@citrix.com>

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

* Re: [PATCH 1/1] xen-netback: add reference from xenvif to backend_info to facilitate coredump analysis
  2019-04-12  6:53 ` [Xen-devel] " Dongli Zhang
  (?)
@ 2019-04-12 14:28 ` Wei Liu
  -1 siblings, 0 replies; 9+ messages in thread
From: Wei Liu @ 2019-04-12 14:28 UTC (permalink / raw)
  To: Dongli Zhang
  Cc: wei.liu2, netdev, joe.jin, linux-kernel, junxiao.bi,
	paul.durrant, jie.l.li, xen-devel, davem

On Fri, Apr 12, 2019 at 02:53:24PM +0800, Dongli Zhang wrote:
> During coredump analysis, it is not easy to obtain the address of
> backend_info in xen-netback.
> 
> So far there are two ways to obtain backend_info:
> 
> 1. Do what xenbus_device_find() does for vmcore to find the xenbus_device
> and then derive it from dev_get_drvdata().
> 
> 2. Extract backend_info from callstack of xenwatch (e.g., netback_remove()
> or frontend_changed()).
> 
> This patch adds a reference from xenvif to backend_info so that it would be
> much more easier to obtain backend_info during coredump analysis.
> 
> Signed-off-by: Dongli Zhang <dongli.zhang@oracle.com>

Acked-by: Wei Liu <wei.liu2@citrix.com>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* Re: [Xen-devel] [PATCH 1/1] xen-netback: add reference from xenvif to backend_info to facilitate coredump analysis
@ 2019-04-12 14:28   ` Wei Liu
  0 siblings, 0 replies; 9+ messages in thread
From: Wei Liu @ 2019-04-12 14:28 UTC (permalink / raw)
  To: Dongli Zhang
  Cc: wei.liu2, netdev, joe.jin, linux-kernel, junxiao.bi,
	paul.durrant, jie.l.li, xen-devel, davem

On Fri, Apr 12, 2019 at 02:53:24PM +0800, Dongli Zhang wrote:
> During coredump analysis, it is not easy to obtain the address of
> backend_info in xen-netback.
> 
> So far there are two ways to obtain backend_info:
> 
> 1. Do what xenbus_device_find() does for vmcore to find the xenbus_device
> and then derive it from dev_get_drvdata().
> 
> 2. Extract backend_info from callstack of xenwatch (e.g., netback_remove()
> or frontend_changed()).
> 
> This patch adds a reference from xenvif to backend_info so that it would be
> much more easier to obtain backend_info during coredump analysis.
> 
> Signed-off-by: Dongli Zhang <dongli.zhang@oracle.com>

Acked-by: Wei Liu <wei.liu2@citrix.com>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* Re: [PATCH 1/1] xen-netback: add reference from xenvif to backend_info to facilitate coredump analysis
  2019-04-12  6:53 ` [Xen-devel] " Dongli Zhang
@ 2019-04-12 17:10   ` David Miller
  -1 siblings, 0 replies; 9+ messages in thread
From: David Miller @ 2019-04-12 17:10 UTC (permalink / raw)
  To: dongli.zhang
  Cc: xen-devel, netdev, linux-kernel, wei.liu2, paul.durrant, joe.jin,
	junxiao.bi, jie.l.li

From: Dongli Zhang <dongli.zhang@oracle.com>
Date: Fri, 12 Apr 2019 14:53:24 +0800

> During coredump analysis, it is not easy to obtain the address of
> backend_info in xen-netback.
> 
> So far there are two ways to obtain backend_info:
> 
> 1. Do what xenbus_device_find() does for vmcore to find the xenbus_device
> and then derive it from dev_get_drvdata().
> 
> 2. Extract backend_info from callstack of xenwatch (e.g., netback_remove()
> or frontend_changed()).
> 
> This patch adds a reference from xenvif to backend_info so that it would be
> much more easier to obtain backend_info during coredump analysis.
> 
> Signed-off-by: Dongli Zhang <dongli.zhang@oracle.com>

Applied to net-next.

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

* Re: [PATCH 1/1] xen-netback: add reference from xenvif to backend_info to facilitate coredump analysis
  2019-04-12  6:53 ` [Xen-devel] " Dongli Zhang
                   ` (2 preceding siblings ...)
  (?)
@ 2019-04-12 17:10 ` David Miller
  -1 siblings, 0 replies; 9+ messages in thread
From: David Miller @ 2019-04-12 17:10 UTC (permalink / raw)
  To: dongli.zhang
  Cc: wei.liu2, netdev, joe.jin, linux-kernel, junxiao.bi,
	paul.durrant, jie.l.li, xen-devel

From: Dongli Zhang <dongli.zhang@oracle.com>
Date: Fri, 12 Apr 2019 14:53:24 +0800

> During coredump analysis, it is not easy to obtain the address of
> backend_info in xen-netback.
> 
> So far there are two ways to obtain backend_info:
> 
> 1. Do what xenbus_device_find() does for vmcore to find the xenbus_device
> and then derive it from dev_get_drvdata().
> 
> 2. Extract backend_info from callstack of xenwatch (e.g., netback_remove()
> or frontend_changed()).
> 
> This patch adds a reference from xenvif to backend_info so that it would be
> much more easier to obtain backend_info during coredump analysis.
> 
> Signed-off-by: Dongli Zhang <dongli.zhang@oracle.com>

Applied to net-next.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* Re: [Xen-devel] [PATCH 1/1] xen-netback: add reference from xenvif to backend_info to facilitate coredump analysis
@ 2019-04-12 17:10   ` David Miller
  0 siblings, 0 replies; 9+ messages in thread
From: David Miller @ 2019-04-12 17:10 UTC (permalink / raw)
  To: dongli.zhang
  Cc: wei.liu2, netdev, joe.jin, linux-kernel, junxiao.bi,
	paul.durrant, jie.l.li, xen-devel

From: Dongli Zhang <dongli.zhang@oracle.com>
Date: Fri, 12 Apr 2019 14:53:24 +0800

> During coredump analysis, it is not easy to obtain the address of
> backend_info in xen-netback.
> 
> So far there are two ways to obtain backend_info:
> 
> 1. Do what xenbus_device_find() does for vmcore to find the xenbus_device
> and then derive it from dev_get_drvdata().
> 
> 2. Extract backend_info from callstack of xenwatch (e.g., netback_remove()
> or frontend_changed()).
> 
> This patch adds a reference from xenvif to backend_info so that it would be
> much more easier to obtain backend_info during coredump analysis.
> 
> Signed-off-by: Dongli Zhang <dongli.zhang@oracle.com>

Applied to net-next.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* [PATCH 1/1] xen-netback: add reference from xenvif to backend_info to facilitate coredump analysis
@ 2019-04-12  6:53 Dongli Zhang
  0 siblings, 0 replies; 9+ messages in thread
From: Dongli Zhang @ 2019-04-12  6:53 UTC (permalink / raw)
  To: xen-devel, netdev
  Cc: wei.liu2, joe.jin, linux-kernel, junxiao.bi, paul.durrant,
	jie.l.li, davem

During coredump analysis, it is not easy to obtain the address of
backend_info in xen-netback.

So far there are two ways to obtain backend_info:

1. Do what xenbus_device_find() does for vmcore to find the xenbus_device
and then derive it from dev_get_drvdata().

2. Extract backend_info from callstack of xenwatch (e.g., netback_remove()
or frontend_changed()).

This patch adds a reference from xenvif to backend_info so that it would be
much more easier to obtain backend_info during coredump analysis.

Signed-off-by: Dongli Zhang <dongli.zhang@oracle.com>
---
 drivers/net/xen-netback/common.h | 18 ++++++++++++++++++
 drivers/net/xen-netback/xenbus.c | 17 +----------------
 2 files changed, 19 insertions(+), 16 deletions(-)

diff --git a/drivers/net/xen-netback/common.h b/drivers/net/xen-netback/common.h
index 936c0b3..05847eb 100644
--- a/drivers/net/xen-netback/common.h
+++ b/drivers/net/xen-netback/common.h
@@ -248,6 +248,22 @@ struct xenvif_hash {
 	struct xenvif_hash_cache cache;
 };
 
+struct backend_info {
+	struct xenbus_device *dev;
+	struct xenvif *vif;
+
+	/* This is the state that will be reflected in xenstore when any
+	 * active hotplug script completes.
+	 */
+	enum xenbus_state state;
+
+	enum xenbus_state frontend_state;
+	struct xenbus_watch hotplug_status_watch;
+	u8 have_hotplug_status_watch:1;
+
+	const char *hotplug_script;
+};
+
 struct xenvif {
 	/* Unique identifier for this interface. */
 	domid_t          domid;
@@ -283,6 +299,8 @@ struct xenvif {
 	struct xenbus_watch credit_watch;
 	struct xenbus_watch mcast_ctrl_watch;
 
+	struct backend_info *be;
+
 	spinlock_t lock;
 
 #ifdef CONFIG_DEBUG_FS
diff --git a/drivers/net/xen-netback/xenbus.c b/drivers/net/xen-netback/xenbus.c
index 330ddb6..41c9e8f 100644
--- a/drivers/net/xen-netback/xenbus.c
+++ b/drivers/net/xen-netback/xenbus.c
@@ -22,22 +22,6 @@
 #include <linux/vmalloc.h>
 #include <linux/rtnetlink.h>
 
-struct backend_info {
-	struct xenbus_device *dev;
-	struct xenvif *vif;
-
-	/* This is the state that will be reflected in xenstore when any
-	 * active hotplug script completes.
-	 */
-	enum xenbus_state state;
-
-	enum xenbus_state frontend_state;
-	struct xenbus_watch hotplug_status_watch;
-	u8 have_hotplug_status_watch:1;
-
-	const char *hotplug_script;
-};
-
 static int connect_data_rings(struct backend_info *be,
 			      struct xenvif_queue *queue);
 static void connect(struct backend_info *be);
@@ -472,6 +456,7 @@ static int backend_create_xenvif(struct backend_info *be)
 		return err;
 	}
 	be->vif = vif;
+	vif->be = be;
 
 	kobject_uevent(&dev->dev.kobj, KOBJ_ONLINE);
 	return 0;
-- 
2.7.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

end of thread, other threads:[~2019-04-12 17:11 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-12  6:53 [PATCH 1/1] xen-netback: add reference from xenvif to backend_info to facilitate coredump analysis Dongli Zhang
2019-04-12  6:53 ` [Xen-devel] " Dongli Zhang
2019-04-12 14:28 ` Wei Liu
2019-04-12 14:28 ` Wei Liu
2019-04-12 14:28   ` [Xen-devel] " Wei Liu
2019-04-12 17:10 ` David Miller
2019-04-12 17:10 ` David Miller
2019-04-12 17:10   ` [Xen-devel] " David Miller
  -- strict thread matches above, loose matches on Subject: below --
2019-04-12  6:53 Dongli Zhang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.