Skip to content

Commit 6dc400a

Browse files
Dongli Zhangdavem330
authored andcommitted
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: Dongli Zhang <dongli.zhang@oracle.com> Acked-by: Wei Liu <wei.liu2@citrix.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 8af9f72 commit 6dc400a

2 files changed

Lines changed: 19 additions & 16 deletions

File tree

‎drivers/net/xen-netback/common.h‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,22 @@ struct xenvif_hash {
248248
struct xenvif_hash_cache cache;
249249
};
250250

251+
struct backend_info {
252+
struct xenbus_device *dev;
253+
struct xenvif *vif;
254+
255+
/* This is the state that will be reflected in xenstore when any
256+
* active hotplug script completes.
257+
*/
258+
enum xenbus_state state;
259+
260+
enum xenbus_state frontend_state;
261+
struct xenbus_watch hotplug_status_watch;
262+
u8 have_hotplug_status_watch:1;
263+
264+
const char *hotplug_script;
265+
};
266+
251267
struct xenvif {
252268
/* Unique identifier for this interface. */
253269
domid_t domid;
@@ -283,6 +299,8 @@ struct xenvif {
283299
struct xenbus_watch credit_watch;
284300
struct xenbus_watch mcast_ctrl_watch;
285301

302+
struct backend_info *be;
303+
286304
spinlock_t lock;
287305

288306
#ifdef CONFIG_DEBUG_FS

‎drivers/net/xen-netback/xenbus.c‎

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,6 @@
2222
#include <linux/vmalloc.h>
2323
#include <linux/rtnetlink.h>
2424

25-
struct backend_info {
26-
struct xenbus_device *dev;
27-
struct xenvif *vif;
28-
29-
/* This is the state that will be reflected in xenstore when any
30-
* active hotplug script completes.
31-
*/
32-
enum xenbus_state state;
33-
34-
enum xenbus_state frontend_state;
35-
struct xenbus_watch hotplug_status_watch;
36-
u8 have_hotplug_status_watch:1;
37-
38-
const char *hotplug_script;
39-
};
40-
4125
static int connect_data_rings(struct backend_info *be,
4226
struct xenvif_queue *queue);
4327
static void connect(struct backend_info *be);
@@ -472,6 +456,7 @@ static int backend_create_xenvif(struct backend_info *be)
472456
return err;
473457
}
474458
be->vif = vif;
459+
vif->be = be;
475460

476461
kobject_uevent(&dev->dev.kobj, KOBJ_ONLINE);
477462
return 0;

0 commit comments

Comments
 (0)