summaryrefslogtreecommitdiffstats
path: root/src/plugins/avf/device.c
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2021-03-26 13:45:37 +0100
committerDamjan Marion <damarion@cisco.com>2021-03-26 16:33:42 +0100
commitf553a2cbbb8cca84ebf033335ebd2cd26dc19d69 (patch)
tree3705c2c0121769dff96a122cef13886d5f0e5205 /src/plugins/avf/device.c
parent6ffb7c61899eb782416cbd2f117042a583f189f7 (diff)
vlib: introduce vlib_get_elog_main()
Type: improvement Change-Id: I73383eb15186021cd6527d112da8443a0082f129 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/plugins/avf/device.c')
-rw-r--r--src/plugins/avf/device.c58
1 files changed, 26 insertions, 32 deletions
diff --git a/src/plugins/avf/device.c b/src/plugins/avf/device.c
index def8a799ecb..4418dfdefbe 100644
--- a/src/plugins/avf/device.c
+++ b/src/plugins/avf/device.c
@@ -183,7 +183,6 @@ retry:
done:
if (ad->flags & AVF_DEVICE_F_ELOG)
{
- /* *INDENT-OFF* */
ELOG_TYPE_DECLARE (el) =
{
.format = "avf[%d] aq enq: s_flags 0x%x r_flags 0x%x opcode 0x%x "
@@ -199,14 +198,13 @@ done:
u16 datalen;
u16 retval;
} *ed;
- ed = ELOG_DATA (&vm->elog_main, el);
- ed->dev_instance = ad->dev_instance;
- ed->s_flags = dc.flags;
- ed->r_flags = d->flags;
- ed->opcode = dc.opcode;
- ed->datalen = dc.datalen;
- ed->retval = d->retval;
- /* *INDENT-ON* */
+ ed = ELOG_DATA (&vlib_global_main.elog_main, el);
+ ed->dev_instance = ad->dev_instance;
+ ed->s_flags = dc.flags;
+ ed->r_flags = d->flags;
+ ed->opcode = dc.opcode;
+ ed->datalen = dc.datalen;
+ ed->retval = d->retval;
}
return err;
@@ -222,7 +220,6 @@ avf_cmd_rx_ctl_reg_write (vlib_main_t * vm, avf_device_t * ad, u32 reg,
if (ad->flags & AVF_DEVICE_F_ELOG)
{
- /* *INDENT-OFF* */
ELOG_TYPE_DECLARE (el) =
{
.format = "avf[%d] rx ctl reg write: reg 0x%x val 0x%x ",
@@ -234,11 +231,10 @@ avf_cmd_rx_ctl_reg_write (vlib_main_t * vm, avf_device_t * ad, u32 reg,
u32 reg;
u32 val;
} *ed;
- ed = ELOG_DATA (&vm->elog_main, el);
- ed->dev_instance = ad->dev_instance;
- ed->reg = reg;
- ed->val = val;
- /* *INDENT-ON* */
+ ed = ELOG_DATA (&vlib_global_main.elog_main, el);
+ ed->dev_instance = ad->dev_instance;
+ ed->reg = reg;
+ ed->val = val;
}
return err;
}
@@ -500,7 +496,6 @@ done:
if (ad->flags & AVF_DEVICE_F_ELOG)
{
- /* *INDENT-OFF* */
ELOG_TYPE_DECLARE (el) =
{
.format = "avf[%d] send to pf: v_opcode %s (%d) v_retval 0x%x",
@@ -519,12 +514,11 @@ done:
u32 v_opcode_val;
u32 v_retval;
} *ed;
- ed = ELOG_DATA (&vm->elog_main, el);
- ed->dev_instance = ad->dev_instance;
- ed->v_opcode = op;
- ed->v_opcode_val = op;
- ed->v_retval = d->v_retval;
- /* *INDENT-ON* */
+ ed = ELOG_DATA (&vlib_global_main.elog_main, el);
+ ed->dev_instance = ad->dev_instance;
+ ed->v_opcode = op;
+ ed->v_opcode_val = op;
+ ed->v_retval = d->v_retval;
}
return err;
}
@@ -1138,10 +1132,10 @@ avf_process_one_device (vlib_main_t * vm, avf_device_t * ad, int is_irq)
u8 link_status;
u32 link_speed;
} *ed;
- ed = ELOG_DATA (&vm->elog_main, el);
- ed->dev_instance = ad->dev_instance;
- ed->link_status = link_up;
- ed->link_speed = mbps;
+ ed = ELOG_DATA (&vlib_global_main.elog_main, el);
+ ed->dev_instance = ad->dev_instance;
+ ed->link_status = link_up;
+ ed->link_speed = mbps;
}
}
else
@@ -1159,10 +1153,10 @@ avf_process_one_device (vlib_main_t * vm, avf_device_t * ad, int is_irq)
u32 event;
u32 severity;
} *ed;
- ed = ELOG_DATA (&vm->elog_main, el);
- ed->dev_instance = ad->dev_instance;
- ed->event = e->event;
- ed->severity = e->severity;
+ ed = ELOG_DATA (&vlib_global_main.elog_main, el);
+ ed->dev_instance = ad->dev_instance;
+ ed->event = e->event;
+ ed->severity = e->severity;
}
}
}
@@ -1374,7 +1368,7 @@ avf_irq_0_handler (vlib_main_t * vm, vlib_pci_dev_handle_t h, u16 line)
u32 icr0;
} *ed;
- ed = ELOG_DATA (&vm->elog_main, el);
+ ed = ELOG_DATA (&vlib_global_main.elog_main, el);
ed->dev_instance = ad->dev_instance;
ed->icr0 = icr0;
}
@@ -1410,7 +1404,7 @@ avf_irq_n_handler (vlib_main_t * vm, vlib_pci_dev_handle_t h, u16 line)
u16 line;
} *ed;
- ed = ELOG_DATA (&vm->elog_main, el);
+ ed = ELOG_DATA (&vlib_global_main.elog_main, el);
ed->dev_instance = ad->dev_instance;
ed->line = line;
}