summaryrefslogtreecommitdiffstats
path: root/src/plugins/avf/cli.c
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2020-09-09 17:40:02 +0200
committerAndrew Yourtchenko <ayourtch@gmail.com>2020-09-11 11:11:02 +0000
commit171d6aceb039a7f0b0d67c837ff74359dae01ae4 (patch)
tree51823e58dcee988384ccf465ff4fd3f18b469c4d /src/plugins/avf/cli.c
parent268e3b647733807dbecf402fcebedceff4c85544 (diff)
avf: fix race between avf and cli/api process
device pool my grow during suspemd which will cause crash in avf process after it exits from suspend. Type: fix Change-Id: I51fec90088c909cfbaaca6c245272a28c0827ca0 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/plugins/avf/cli.c')
-rw-r--r--src/plugins/avf/cli.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/plugins/avf/cli.c b/src/plugins/avf/cli.c
index 29c2a6b1f6e..32c19f46590 100644
--- a/src/plugins/avf/cli.c
+++ b/src/plugins/avf/cli.c
@@ -134,7 +134,6 @@ avf_test_command_fn (vlib_main_t * vm, unformat_input_t * input,
unformat_input_t _line_input, *line_input = &_line_input;
u32 sw_if_index = ~0;
vnet_hw_interface_t *hw;
- avf_main_t *am = &avf_main;
avf_device_t *ad;
vnet_main_t *vnm = vnet_get_main ();
int test_irq = 0, enable_elog = 0, disable_elog = 0;
@@ -170,7 +169,7 @@ avf_test_command_fn (vlib_main_t * vm, unformat_input_t * input,
if (hw == NULL || avf_device_class.index != hw->dev_class_index)
return clib_error_return (0, "not a AVF interface");
- ad = pool_elt_at_index (am->devices, hw->dev_instance);
+ ad = avf_get_device (hw->dev_instance);
if (enable_elog)
ad->flags |= AVF_DEVICE_F_ELOG;