Commit 6dc400af authored by Dongli Zhang's avatar Dongli Zhang Committed by David S. Miller

xen-netback: add reference from xenvif to backend_info to facilitate coredump analysis

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: default avatarDongli Zhang <dongli.zhang@oracle.com>
Acked-by: default avatarWei Liu <wei.liu2@citrix.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8af9f729
...@@ -248,6 +248,22 @@ struct xenvif_hash { ...@@ -248,6 +248,22 @@ struct xenvif_hash {
struct xenvif_hash_cache cache; 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 { struct xenvif {
/* Unique identifier for this interface. */ /* Unique identifier for this interface. */
domid_t domid; domid_t domid;
...@@ -283,6 +299,8 @@ struct xenvif { ...@@ -283,6 +299,8 @@ struct xenvif {
struct xenbus_watch credit_watch; struct xenbus_watch credit_watch;
struct xenbus_watch mcast_ctrl_watch; struct xenbus_watch mcast_ctrl_watch;
struct backend_info *be;
spinlock_t lock; spinlock_t lock;
#ifdef CONFIG_DEBUG_FS #ifdef CONFIG_DEBUG_FS
......
...@@ -22,22 +22,6 @@ ...@@ -22,22 +22,6 @@
#include <linux/vmalloc.h> #include <linux/vmalloc.h>
#include <linux/rtnetlink.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, static int connect_data_rings(struct backend_info *be,
struct xenvif_queue *queue); struct xenvif_queue *queue);
static void connect(struct backend_info *be); static void connect(struct backend_info *be);
...@@ -472,6 +456,7 @@ static int backend_create_xenvif(struct backend_info *be) ...@@ -472,6 +456,7 @@ static int backend_create_xenvif(struct backend_info *be)
return err; return err;
} }
be->vif = vif; be->vif = vif;
vif->be = be;
kobject_uevent(&dev->dev.kobj, KOBJ_ONLINE); kobject_uevent(&dev->dev.kobj, KOBJ_ONLINE);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment