From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E652E41D4F for ; Thu, 23 Feb 2023 10:40:16 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E0CF243158; Thu, 23 Feb 2023 10:40:16 +0100 (CET) Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) by mails.dpdk.org (Postfix) with ESMTP id E45D343158 for ; Thu, 23 Feb 2023 10:40:15 +0100 (CET) Received: by mail-wr1-f52.google.com with SMTP id r7so9974779wrz.6 for ; Thu, 23 Feb 2023 01:40:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=9NV+u9uprgAwbGouL46v6762LSFBrBFzatvM0YsgoEE=; b=SYSbZISZNAPeKhbbEy4Pj8uMS4srWnBGDrH12IEMMSrQWqY5RdaqcGler13bttYMuF tZmGchppvD9Gk5m5fJDoQfyPCDzU4YNE0IHpOFyKEqMAQ9DOWAMyNsNrPxiuqTZ6bbfM CBrjleBjeGc0x+QDA3DnQXPv3wxy50ES836oFXC7Tjn6kL8e56AW+0/dvObtOnWUApUd seS0hmaKSoVm5PPGFnXNc2UhtpIar+7E8bER6btcdpVBGlkcs/V+W6ZgJ5JSgOjF8ouq wh21bPBEZK7tZGyxbX8QK6A26StrKJRHQJ/Cj1r9jpsiku/rVC6iIXWhgLVj1aq5fOUe Ce3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9NV+u9uprgAwbGouL46v6762LSFBrBFzatvM0YsgoEE=; b=ffcCLQjGNv5Biay1mEScltZCssQgJ3aOq392HFVJyvQZDNTKI+USWHBrfbkNjACDM7 IBx9tQ6VCRhKnEH9RXKvqc848/xeHotsTZ2NKNLRPpDENHoHh8iKdsSsUSvJyQxFkcnH MFHLknaJz0fbwqw7STeM+Q8ZisW4Gsf44cDsdPu7FCen2FFT+C/9uOBY1xgiTMOCXK2B lDCmQ+JQW+8DCuD0PpZlH4BHV4e0qOrbzjGj2vZB98O7DJooJ9sdYqkoJNTDDA7Sm/j4 98AlOqWuXRvGqR5L4IDWGwC88QwxJ9qib2NmdLdckv0QcY/sEDClHVy6Oim3fp99xpIp RSJw== X-Gm-Message-State: AO0yUKXedDyV4rM8IPud0NDkU5vPJpi9K1FxbdR0iQy0kmDGY8ruY0Cf ksgxuMkZwcIaXmfe7ddlOPjzTe88ys+2Vw== X-Google-Smtp-Source: AK7set/dK7zEEwBaSiP05d9WWqGzs4iSzX7ErUloNngiR977iLOs3UvwX6sbAhs0Yoy7oxs5ZaMC7w== X-Received: by 2002:a5d:6501:0:b0:2c5:5701:8d03 with SMTP id x1-20020a5d6501000000b002c557018d03mr10030131wru.13.1677145215556; Thu, 23 Feb 2023 01:40:15 -0800 (PST) Received: from localhost ([137.220.119.58]) by smtp.gmail.com with ESMTPSA id n8-20020a05600c294800b003e876122dc1sm6246499wmd.47.2023.02.23.01.40.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Feb 2023 01:40:15 -0800 (PST) From: luca.boccassi@gmail.com To: Mike Pattrick Cc: Qi Zhang , dpdk stable Subject: patch 'net/iavf: add lock for VF commands' has been queued to stable release 20.11.8 Date: Thu, 23 Feb 2023 09:37:00 +0000 Message-Id: <20230223093715.3926893-56-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230223093715.3926893-1-luca.boccassi@gmail.com> References: <20230223093715.3926893-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 20.11.8 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 02/25/23. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/a44e4276ba85ff1f146ee7e50710d0102087dc69 Thanks. Luca Boccassi --- >From a44e4276ba85ff1f146ee7e50710d0102087dc69 Mon Sep 17 00:00:00 2001 From: Mike Pattrick Date: Wed, 28 Dec 2022 18:00:25 -0500 Subject: [PATCH] net/iavf: add lock for VF commands [ upstream commit 91bf37d250aacfc9512a33ce9ec6d4783766804e ] iavf admin queue commands aren't thread-safe. Bugs surrounding this issue can manifest in a variety of ways but frequently pend_cmd is over written. Simultaneously executing commands can result in a misconfigured device or DPDK sleeping in a thread for 2 second. Despite this limitation, vf commands may be executed from both iavf_dev_alarm_handler() in a control thread and the applications main thread. This is trivial to simulate in the testpmd application by creating a bond of vf's in active backup mode, and then turning the bond off and then on again repeatedly. Previously [1] was proposed as a potential solution, but this commit did not resolve all potential issues concerning the admin queue and has been reverted from the stable branch. I propose adding locks until a more complete solution is available. [1] commit cb5c1b91f76f ("net/iavf: add thread for event callbacks") Fixes: 48de41ca11f0 ("net/avf: enable link status update") Fixes: 84108425054a ("net/iavf: support asynchronous virtual channel message") Signed-off-by: Mike Pattrick Acked-by: Qi Zhang --- drivers/net/iavf/iavf.h | 1 + drivers/net/iavf/iavf_vchnl.c | 72 ++++++++++++++++++++++------------- 2 files changed, 46 insertions(+), 27 deletions(-) diff --git a/drivers/net/iavf/iavf.h b/drivers/net/iavf/iavf.h index 41d9856358..f0408c2b40 100644 --- a/drivers/net/iavf/iavf.h +++ b/drivers/net/iavf/iavf.h @@ -160,6 +160,7 @@ struct iavf_info { struct iavf_qv_map *qv_map; /* queue vector mapping */ struct iavf_flow_list flow_list; rte_spinlock_t flow_ops_lock; + rte_spinlock_t aq_lock; struct iavf_parser_list rss_parser_list; struct iavf_parser_list dist_parser_list; diff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c index 77f10a90c7..4c6efaac3a 100644 --- a/drivers/net/iavf/iavf_vchnl.c +++ b/drivers/net/iavf/iavf_vchnl.c @@ -387,6 +387,20 @@ iavf_execute_vf_cmd(struct iavf_adapter *adapter, struct iavf_cmd_info *args) return err; } +static int +iavf_execute_vf_cmd_safe(struct iavf_adapter *adapter, + struct iavf_cmd_info *args) +{ + struct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(adapter); + int ret; + + rte_spinlock_lock(&vf->aq_lock); + ret = iavf_execute_vf_cmd(adapter, args); + rte_spinlock_unlock(&vf->aq_lock); + + return ret; +} + static void iavf_handle_pf_event_msg(struct rte_eth_dev *dev, uint8_t *msg, uint16_t msglen) @@ -504,7 +518,7 @@ iavf_enable_vlan_strip(struct iavf_adapter *adapter) args.in_args_size = 0; args.out_buffer = vf->aq_resp; args.out_size = IAVF_AQ_BUF_SZ; - ret = iavf_execute_vf_cmd(adapter, &args); + ret = iavf_execute_vf_cmd_safe(adapter, &args); if (ret) PMD_DRV_LOG(ERR, "Failed to execute command of" " OP_ENABLE_VLAN_STRIPPING"); @@ -525,7 +539,7 @@ iavf_disable_vlan_strip(struct iavf_adapter *adapter) args.in_args_size = 0; args.out_buffer = vf->aq_resp; args.out_size = IAVF_AQ_BUF_SZ; - ret = iavf_execute_vf_cmd(adapter, &args); + ret = iavf_execute_vf_cmd_safe(adapter, &args); if (ret) PMD_DRV_LOG(ERR, "Failed to execute command of" " OP_DISABLE_VLAN_STRIPPING"); @@ -554,7 +568,7 @@ iavf_check_api_version(struct iavf_adapter *adapter) args.out_buffer = vf->aq_resp; args.out_size = IAVF_AQ_BUF_SZ; - err = iavf_execute_vf_cmd(adapter, &args); + err = iavf_execute_vf_cmd_safe(adapter, &args); if (err) { PMD_INIT_LOG(ERR, "Fail to execute command of OP_VERSION"); return err; @@ -609,7 +623,7 @@ iavf_get_vf_resource(struct iavf_adapter *adapter) args.in_args = (uint8_t *)∩︀ args.in_args_size = sizeof(caps); - err = iavf_execute_vf_cmd(adapter, &args); + err = iavf_execute_vf_cmd_safe(adapter, &args); if (err) { PMD_DRV_LOG(ERR, @@ -654,7 +668,7 @@ iavf_get_supported_rxdid(struct iavf_adapter *adapter) args.out_buffer = vf->aq_resp; args.out_size = IAVF_AQ_BUF_SZ; - ret = iavf_execute_vf_cmd(adapter, &args); + ret = iavf_execute_vf_cmd_safe(adapter, &args); if (ret) { PMD_DRV_LOG(ERR, "Failed to execute command of OP_GET_SUPPORTED_RXDIDS"); @@ -686,7 +700,7 @@ iavf_enable_queues(struct iavf_adapter *adapter) args.in_args_size = sizeof(queue_select); args.out_buffer = vf->aq_resp; args.out_size = IAVF_AQ_BUF_SZ; - err = iavf_execute_vf_cmd(adapter, &args); + err = iavf_execute_vf_cmd_safe(adapter, &args); if (err) { PMD_DRV_LOG(ERR, "Failed to execute command of OP_ENABLE_QUEUES"); @@ -714,7 +728,7 @@ iavf_disable_queues(struct iavf_adapter *adapter) args.in_args_size = sizeof(queue_select); args.out_buffer = vf->aq_resp; args.out_size = IAVF_AQ_BUF_SZ; - err = iavf_execute_vf_cmd(adapter, &args); + err = iavf_execute_vf_cmd_safe(adapter, &args); if (err) { PMD_DRV_LOG(ERR, "Failed to execute command of OP_DISABLE_QUEUES"); @@ -747,7 +761,7 @@ iavf_switch_queue(struct iavf_adapter *adapter, uint16_t qid, args.in_args_size = sizeof(queue_select); args.out_buffer = vf->aq_resp; args.out_size = IAVF_AQ_BUF_SZ; - err = iavf_execute_vf_cmd(adapter, &args); + err = iavf_execute_vf_cmd_safe(adapter, &args); if (err) PMD_DRV_LOG(ERR, "Failed to execute command of %s", on ? "OP_ENABLE_QUEUES" : "OP_DISABLE_QUEUES"); @@ -789,7 +803,7 @@ iavf_enable_queues_lv(struct iavf_adapter *adapter) args.in_args_size = len; args.out_buffer = vf->aq_resp; args.out_size = IAVF_AQ_BUF_SZ; - err = iavf_execute_vf_cmd(adapter, &args); + err = iavf_execute_vf_cmd_safe(adapter, &args); if (err) PMD_DRV_LOG(ERR, "Failed to execute command of OP_ENABLE_QUEUES_V2"); @@ -833,7 +847,7 @@ iavf_disable_queues_lv(struct iavf_adapter *adapter) args.in_args_size = len; args.out_buffer = vf->aq_resp; args.out_size = IAVF_AQ_BUF_SZ; - err = iavf_execute_vf_cmd(adapter, &args); + err = iavf_execute_vf_cmd_safe(adapter, &args); if (err) PMD_DRV_LOG(ERR, "Failed to execute command of OP_DISABLE_QUEUES_V2"); @@ -879,7 +893,7 @@ iavf_switch_queue_lv(struct iavf_adapter *adapter, uint16_t qid, args.in_args_size = len; args.out_buffer = vf->aq_resp; args.out_size = IAVF_AQ_BUF_SZ; - err = iavf_execute_vf_cmd(adapter, &args); + err = iavf_execute_vf_cmd_safe(adapter, &args); if (err) PMD_DRV_LOG(ERR, "Failed to execute command of %s", on ? "OP_ENABLE_QUEUES_V2" : "OP_DISABLE_QUEUES_V2"); @@ -911,7 +925,7 @@ iavf_configure_rss_lut(struct iavf_adapter *adapter) args.out_buffer = vf->aq_resp; args.out_size = IAVF_AQ_BUF_SZ; - err = iavf_execute_vf_cmd(adapter, &args); + err = iavf_execute_vf_cmd_safe(adapter, &args); if (err) PMD_DRV_LOG(ERR, "Failed to execute command of OP_CONFIG_RSS_LUT"); @@ -943,7 +957,7 @@ iavf_configure_rss_key(struct iavf_adapter *adapter) args.out_buffer = vf->aq_resp; args.out_size = IAVF_AQ_BUF_SZ; - err = iavf_execute_vf_cmd(adapter, &args); + err = iavf_execute_vf_cmd_safe(adapter, &args); if (err) PMD_DRV_LOG(ERR, "Failed to execute command of OP_CONFIG_RSS_KEY"); @@ -1035,7 +1049,7 @@ iavf_configure_queues(struct iavf_adapter *adapter, args.out_buffer = vf->aq_resp; args.out_size = IAVF_AQ_BUF_SZ; - err = iavf_execute_vf_cmd(adapter, &args); + err = iavf_execute_vf_cmd_safe(adapter, &args); if (err) PMD_DRV_LOG(ERR, "Failed to execute command of" " VIRTCHNL_OP_CONFIG_VSI_QUEUES"); @@ -1076,7 +1090,7 @@ iavf_config_irq_map(struct iavf_adapter *adapter) args.in_args_size = len; args.out_buffer = vf->aq_resp; args.out_size = IAVF_AQ_BUF_SZ; - err = iavf_execute_vf_cmd(adapter, &args); + err = iavf_execute_vf_cmd_safe(adapter, &args); if (err) PMD_DRV_LOG(ERR, "fail to execute command OP_CONFIG_IRQ_MAP"); @@ -1117,7 +1131,7 @@ iavf_config_irq_map_lv(struct iavf_adapter *adapter, uint16_t num, args.in_args_size = len; args.out_buffer = vf->aq_resp; args.out_size = IAVF_AQ_BUF_SZ; - err = iavf_execute_vf_cmd(adapter, &args); + err = iavf_execute_vf_cmd_safe(adapter, &args); if (err) PMD_DRV_LOG(ERR, "fail to execute command OP_MAP_QUEUE_VECTOR"); @@ -1179,7 +1193,7 @@ iavf_add_del_all_mac_addr(struct iavf_adapter *adapter, bool add) args.in_args_size = len; args.out_buffer = vf->aq_resp; args.out_size = IAVF_AQ_BUF_SZ; - err = iavf_execute_vf_cmd(adapter, &args); + err = iavf_execute_vf_cmd_safe(adapter, &args); if (err) PMD_DRV_LOG(ERR, "fail to execute command %s", add ? "OP_ADD_ETHER_ADDRESS" : @@ -1206,7 +1220,7 @@ iavf_query_stats(struct iavf_adapter *adapter, args.out_buffer = vf->aq_resp; args.out_size = IAVF_AQ_BUF_SZ; - err = iavf_execute_vf_cmd(adapter, &args); + err = iavf_execute_vf_cmd_safe(adapter, &args); if (err) { PMD_DRV_LOG(ERR, "fail to execute command OP_GET_STATS"); *pstats = NULL; @@ -1241,7 +1255,7 @@ iavf_config_promisc(struct iavf_adapter *adapter, args.out_buffer = vf->aq_resp; args.out_size = IAVF_AQ_BUF_SZ; - err = iavf_execute_vf_cmd(adapter, &args); + err = iavf_execute_vf_cmd_safe(adapter, &args); if (err) { PMD_DRV_LOG(ERR, @@ -1281,7 +1295,7 @@ iavf_add_del_eth_addr(struct iavf_adapter *adapter, struct rte_ether_addr *addr, args.in_args_size = sizeof(cmd_buffer); args.out_buffer = vf->aq_resp; args.out_size = IAVF_AQ_BUF_SZ; - err = iavf_execute_vf_cmd(adapter, &args); + err = iavf_execute_vf_cmd_safe(adapter, &args); if (err) PMD_DRV_LOG(ERR, "fail to execute command %s", add ? "OP_ADD_ETH_ADDR" : "OP_DEL_ETH_ADDR"); @@ -1308,7 +1322,7 @@ iavf_add_del_vlan(struct iavf_adapter *adapter, uint16_t vlanid, bool add) args.in_args_size = sizeof(cmd_buffer); args.out_buffer = vf->aq_resp; args.out_size = IAVF_AQ_BUF_SZ; - err = iavf_execute_vf_cmd(adapter, &args); + err = iavf_execute_vf_cmd_safe(adapter, &args); if (err) PMD_DRV_LOG(ERR, "fail to execute command %s", add ? "OP_ADD_VLAN" : "OP_DEL_VLAN"); @@ -1335,7 +1349,7 @@ iavf_fdir_add(struct iavf_adapter *adapter, args.out_buffer = vf->aq_resp; args.out_size = IAVF_AQ_BUF_SZ; - err = iavf_execute_vf_cmd(adapter, &args); + err = iavf_execute_vf_cmd_safe(adapter, &args); if (err) { PMD_DRV_LOG(ERR, "fail to execute command OP_ADD_FDIR_FILTER"); return err; @@ -1395,7 +1409,7 @@ iavf_fdir_del(struct iavf_adapter *adapter, args.out_buffer = vf->aq_resp; args.out_size = IAVF_AQ_BUF_SZ; - err = iavf_execute_vf_cmd(adapter, &args); + err = iavf_execute_vf_cmd_safe(adapter, &args); if (err) { PMD_DRV_LOG(ERR, "fail to execute command OP_DEL_FDIR_FILTER"); return err; @@ -1442,7 +1456,7 @@ iavf_fdir_check(struct iavf_adapter *adapter, args.out_buffer = vf->aq_resp; args.out_size = IAVF_AQ_BUF_SZ; - err = iavf_execute_vf_cmd(adapter, &args); + err = iavf_execute_vf_cmd_safe(adapter, &args); if (err) { PMD_DRV_LOG(ERR, "fail to check flow director rule"); return err; @@ -1483,7 +1497,7 @@ iavf_add_del_rss_cfg(struct iavf_adapter *adapter, args.out_buffer = vf->aq_resp; args.out_size = IAVF_AQ_BUF_SZ; - err = iavf_execute_vf_cmd(adapter, &args); + err = iavf_execute_vf_cmd_safe(adapter, &args); if (err) PMD_DRV_LOG(ERR, "Failed to execute command of %s", @@ -1536,7 +1550,7 @@ iavf_add_del_mc_addr_list(struct iavf_adapter *adapter, i * sizeof(struct virtchnl_ether_addr); args.out_buffer = vf->aq_resp; args.out_size = IAVF_AQ_BUF_SZ; - err = iavf_execute_vf_cmd(adapter, &args); + err = iavf_execute_vf_cmd_safe(adapter, &args); if (err) { PMD_DRV_LOG(ERR, "fail to execute command %s", @@ -1580,10 +1594,14 @@ iavf_request_queues(struct rte_eth_dev *dev, uint16_t num) /* * disable interrupt to avoid the admin queue message to be read * before iavf_read_msg_from_pf. + * + * don't disable interrupt handler until ready to execute vf cmd. */ + rte_spinlock_lock(&vf->aq_lock); rte_intr_disable(&pci_dev->intr_handle); err = iavf_execute_vf_cmd(adapter, &args); rte_intr_enable(&pci_dev->intr_handle); + rte_spinlock_unlock(&vf->aq_lock); if (err) { PMD_DRV_LOG(ERR, "fail to execute command OP_REQUEST_QUEUES"); return err; @@ -1618,7 +1636,7 @@ iavf_get_max_rss_queue_region(struct iavf_adapter *adapter) args.out_buffer = vf->aq_resp; args.out_size = IAVF_AQ_BUF_SZ; - err = iavf_execute_vf_cmd(adapter, &args); + err = iavf_execute_vf_cmd_safe(adapter, &args); if (err) { PMD_DRV_LOG(ERR, "Failed to execute command of VIRTCHNL_OP_GET_MAX_RSS_QREGION"); return err; -- 2.39.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-02-23 09:36:30.470745817 +0000 +++ 0056-net-iavf-add-lock-for-VF-commands.patch 2023-02-23 09:36:28.326171781 +0000 @@ -1 +1 @@ -From 91bf37d250aacfc9512a33ce9ec6d4783766804e Mon Sep 17 00:00:00 2001 +From a44e4276ba85ff1f146ee7e50710d0102087dc69 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 91bf37d250aacfc9512a33ce9ec6d4783766804e ] + @@ -26 +27,0 @@ -Cc: stable@dpdk.org @@ -31,3 +32,3 @@ - drivers/net/iavf/iavf.h | 1 + - drivers/net/iavf/iavf_vchnl.c | 106 ++++++++++++++++++++-------------- - 2 files changed, 63 insertions(+), 44 deletions(-) + drivers/net/iavf/iavf.h | 1 + + drivers/net/iavf/iavf_vchnl.c | 72 ++++++++++++++++++++++------------- + 2 files changed, 46 insertions(+), 27 deletions(-) @@ -36 +37 @@ -index 1edebab8dc..aa18650ffa 100644 +index 41d9856358..f0408c2b40 100644 @@ -39 +40 @@ -@@ -262,6 +262,7 @@ struct iavf_info { +@@ -160,6 +160,7 @@ struct iavf_info { @@ -46 +47 @@ - struct iavf_parser_list ipsec_crypto_parser_list; + @@ -48 +49 @@ -index f92daf97f2..9adaadb173 100644 +index 77f10a90c7..4c6efaac3a 100644 @@ -51 +52 @@ -@@ -397,6 +397,20 @@ iavf_execute_vf_cmd(struct iavf_adapter *adapter, struct iavf_cmd_info *args, +@@ -387,6 +387,20 @@ iavf_execute_vf_cmd(struct iavf_adapter *adapter, struct iavf_cmd_info *args) @@ -57 +58 @@ -+ struct iavf_cmd_info *args, int async) ++ struct iavf_cmd_info *args) @@ -63 +64 @@ -+ ret = iavf_execute_vf_cmd(adapter, args, async); ++ ret = iavf_execute_vf_cmd(adapter, args); @@ -72 +73 @@ -@@ -554,7 +568,7 @@ iavf_enable_vlan_strip(struct iavf_adapter *adapter) +@@ -504,7 +518,7 @@ iavf_enable_vlan_strip(struct iavf_adapter *adapter) @@ -76,2 +77,2 @@ -- ret = iavf_execute_vf_cmd(adapter, &args, 0); -+ ret = iavf_execute_vf_cmd_safe(adapter, &args, 0); +- ret = iavf_execute_vf_cmd(adapter, &args); ++ ret = iavf_execute_vf_cmd_safe(adapter, &args); @@ -81 +82 @@ -@@ -575,7 +589,7 @@ iavf_disable_vlan_strip(struct iavf_adapter *adapter) +@@ -525,7 +539,7 @@ iavf_disable_vlan_strip(struct iavf_adapter *adapter) @@ -85,2 +86,2 @@ -- ret = iavf_execute_vf_cmd(adapter, &args, 0); -+ ret = iavf_execute_vf_cmd_safe(adapter, &args, 0); +- ret = iavf_execute_vf_cmd(adapter, &args); ++ ret = iavf_execute_vf_cmd_safe(adapter, &args); @@ -90 +91 @@ -@@ -604,7 +618,7 @@ iavf_check_api_version(struct iavf_adapter *adapter) +@@ -554,7 +568,7 @@ iavf_check_api_version(struct iavf_adapter *adapter) @@ -94,2 +95,2 @@ -- err = iavf_execute_vf_cmd(adapter, &args, 0); -+ err = iavf_execute_vf_cmd_safe(adapter, &args, 0); +- err = iavf_execute_vf_cmd(adapter, &args); ++ err = iavf_execute_vf_cmd_safe(adapter, &args); @@ -99 +100 @@ -@@ -665,7 +679,7 @@ iavf_get_vf_resource(struct iavf_adapter *adapter) +@@ -609,7 +623,7 @@ iavf_get_vf_resource(struct iavf_adapter *adapter) @@ -103,2 +104,2 @@ -- err = iavf_execute_vf_cmd(adapter, &args, 0); -+ err = iavf_execute_vf_cmd_safe(adapter, &args, 0); +- err = iavf_execute_vf_cmd(adapter, &args); ++ err = iavf_execute_vf_cmd_safe(adapter, &args); @@ -108 +109 @@ -@@ -710,7 +724,7 @@ iavf_get_supported_rxdid(struct iavf_adapter *adapter) +@@ -654,7 +668,7 @@ iavf_get_supported_rxdid(struct iavf_adapter *adapter) @@ -112,2 +113,2 @@ -- ret = iavf_execute_vf_cmd(adapter, &args, 0); -+ ret = iavf_execute_vf_cmd_safe(adapter, &args, 0); +- ret = iavf_execute_vf_cmd(adapter, &args); ++ ret = iavf_execute_vf_cmd_safe(adapter, &args); @@ -117,37 +118 @@ -@@ -754,7 +768,7 @@ iavf_config_vlan_strip_v2(struct iavf_adapter *adapter, bool enable) - args.in_args_size = sizeof(vlan_strip); - args.out_buffer = vf->aq_resp; - args.out_size = IAVF_AQ_BUF_SZ; -- ret = iavf_execute_vf_cmd(adapter, &args, 0); -+ ret = iavf_execute_vf_cmd_safe(adapter, &args, 0); - if (ret) - PMD_DRV_LOG(ERR, "fail to execute command %s", - enable ? "VIRTCHNL_OP_ENABLE_VLAN_STRIPPING_V2" : -@@ -794,7 +808,7 @@ iavf_config_vlan_insert_v2(struct iavf_adapter *adapter, bool enable) - args.in_args_size = sizeof(vlan_insert); - args.out_buffer = vf->aq_resp; - args.out_size = IAVF_AQ_BUF_SZ; -- ret = iavf_execute_vf_cmd(adapter, &args, 0); -+ ret = iavf_execute_vf_cmd_safe(adapter, &args, 0); - if (ret) - PMD_DRV_LOG(ERR, "fail to execute command %s", - enable ? "VIRTCHNL_OP_ENABLE_VLAN_INSERTION_V2" : -@@ -837,7 +851,7 @@ iavf_add_del_vlan_v2(struct iavf_adapter *adapter, uint16_t vlanid, bool add) - args.in_args_size = sizeof(vlan_filter); - args.out_buffer = vf->aq_resp; - args.out_size = IAVF_AQ_BUF_SZ; -- err = iavf_execute_vf_cmd(adapter, &args, 0); -+ err = iavf_execute_vf_cmd_safe(adapter, &args, 0); - if (err) - PMD_DRV_LOG(ERR, "fail to execute command %s", - add ? "OP_ADD_VLAN_V2" : "OP_DEL_VLAN_V2"); -@@ -858,7 +872,7 @@ iavf_get_vlan_offload_caps_v2(struct iavf_adapter *adapter) - args.out_buffer = vf->aq_resp; - args.out_size = IAVF_AQ_BUF_SZ; - -- ret = iavf_execute_vf_cmd(adapter, &args, 0); -+ ret = iavf_execute_vf_cmd_safe(adapter, &args, 0); - if (ret) { - PMD_DRV_LOG(ERR, - "Failed to execute command of VIRTCHNL_OP_GET_OFFLOAD_VLAN_V2_CAPS"); -@@ -889,7 +903,7 @@ iavf_enable_queues(struct iavf_adapter *adapter) +@@ -686,7 +700,7 @@ iavf_enable_queues(struct iavf_adapter *adapter) @@ -157,2 +122,2 @@ -- err = iavf_execute_vf_cmd(adapter, &args, 0); -+ err = iavf_execute_vf_cmd_safe(adapter, &args, 0); +- err = iavf_execute_vf_cmd(adapter, &args); ++ err = iavf_execute_vf_cmd_safe(adapter, &args); @@ -162 +127 @@ -@@ -917,7 +931,7 @@ iavf_disable_queues(struct iavf_adapter *adapter) +@@ -714,7 +728,7 @@ iavf_disable_queues(struct iavf_adapter *adapter) @@ -166,2 +131,2 @@ -- err = iavf_execute_vf_cmd(adapter, &args, 0); -+ err = iavf_execute_vf_cmd_safe(adapter, &args, 0); +- err = iavf_execute_vf_cmd(adapter, &args); ++ err = iavf_execute_vf_cmd_safe(adapter, &args); @@ -171 +136 @@ -@@ -953,7 +967,7 @@ iavf_switch_queue(struct iavf_adapter *adapter, uint16_t qid, +@@ -747,7 +761,7 @@ iavf_switch_queue(struct iavf_adapter *adapter, uint16_t qid, @@ -175,2 +140,2 @@ -- err = iavf_execute_vf_cmd(adapter, &args, 0); -+ err = iavf_execute_vf_cmd_safe(adapter, &args, 0); +- err = iavf_execute_vf_cmd(adapter, &args); ++ err = iavf_execute_vf_cmd_safe(adapter, &args); @@ -180 +145 @@ -@@ -995,7 +1009,7 @@ iavf_enable_queues_lv(struct iavf_adapter *adapter) +@@ -789,7 +803,7 @@ iavf_enable_queues_lv(struct iavf_adapter *adapter) @@ -184,2 +149,2 @@ -- err = iavf_execute_vf_cmd(adapter, &args, 0); -+ err = iavf_execute_vf_cmd_safe(adapter, &args, 0); +- err = iavf_execute_vf_cmd(adapter, &args); ++ err = iavf_execute_vf_cmd_safe(adapter, &args); @@ -189 +154 @@ -@@ -1039,7 +1053,7 @@ iavf_disable_queues_lv(struct iavf_adapter *adapter) +@@ -833,7 +847,7 @@ iavf_disable_queues_lv(struct iavf_adapter *adapter) @@ -193,2 +158,2 @@ -- err = iavf_execute_vf_cmd(adapter, &args, 0); -+ err = iavf_execute_vf_cmd_safe(adapter, &args, 0); +- err = iavf_execute_vf_cmd(adapter, &args); ++ err = iavf_execute_vf_cmd_safe(adapter, &args); @@ -198 +163 @@ -@@ -1085,7 +1099,7 @@ iavf_switch_queue_lv(struct iavf_adapter *adapter, uint16_t qid, +@@ -879,7 +893,7 @@ iavf_switch_queue_lv(struct iavf_adapter *adapter, uint16_t qid, @@ -202,2 +167,2 @@ -- err = iavf_execute_vf_cmd(adapter, &args, 0); -+ err = iavf_execute_vf_cmd_safe(adapter, &args, 0); +- err = iavf_execute_vf_cmd(adapter, &args); ++ err = iavf_execute_vf_cmd_safe(adapter, &args); @@ -207 +172 @@ -@@ -1117,7 +1131,7 @@ iavf_configure_rss_lut(struct iavf_adapter *adapter) +@@ -911,7 +925,7 @@ iavf_configure_rss_lut(struct iavf_adapter *adapter) @@ -211,2 +176,2 @@ -- err = iavf_execute_vf_cmd(adapter, &args, 0); -+ err = iavf_execute_vf_cmd_safe(adapter, &args, 0); +- err = iavf_execute_vf_cmd(adapter, &args); ++ err = iavf_execute_vf_cmd_safe(adapter, &args); @@ -216 +181 @@ -@@ -1149,7 +1163,7 @@ iavf_configure_rss_key(struct iavf_adapter *adapter) +@@ -943,7 +957,7 @@ iavf_configure_rss_key(struct iavf_adapter *adapter) @@ -220,2 +185,2 @@ -- err = iavf_execute_vf_cmd(adapter, &args, 0); -+ err = iavf_execute_vf_cmd_safe(adapter, &args, 0); +- err = iavf_execute_vf_cmd(adapter, &args); ++ err = iavf_execute_vf_cmd_safe(adapter, &args); @@ -225 +190 @@ -@@ -1247,7 +1261,7 @@ iavf_configure_queues(struct iavf_adapter *adapter, +@@ -1035,7 +1049,7 @@ iavf_configure_queues(struct iavf_adapter *adapter, @@ -229,2 +194,2 @@ -- err = iavf_execute_vf_cmd(adapter, &args, 0); -+ err = iavf_execute_vf_cmd_safe(adapter, &args, 0); +- err = iavf_execute_vf_cmd(adapter, &args); ++ err = iavf_execute_vf_cmd_safe(adapter, &args); @@ -234 +199 @@ -@@ -1288,7 +1302,7 @@ iavf_config_irq_map(struct iavf_adapter *adapter) +@@ -1076,7 +1090,7 @@ iavf_config_irq_map(struct iavf_adapter *adapter) @@ -238,2 +203,2 @@ -- err = iavf_execute_vf_cmd(adapter, &args, 0); -+ err = iavf_execute_vf_cmd_safe(adapter, &args, 0); +- err = iavf_execute_vf_cmd(adapter, &args); ++ err = iavf_execute_vf_cmd_safe(adapter, &args); @@ -243 +208 @@ -@@ -1329,7 +1343,7 @@ iavf_config_irq_map_lv(struct iavf_adapter *adapter, uint16_t num, +@@ -1117,7 +1131,7 @@ iavf_config_irq_map_lv(struct iavf_adapter *adapter, uint16_t num, @@ -247,2 +212,2 @@ -- err = iavf_execute_vf_cmd(adapter, &args, 0); -+ err = iavf_execute_vf_cmd_safe(adapter, &args, 0); +- err = iavf_execute_vf_cmd(adapter, &args); ++ err = iavf_execute_vf_cmd_safe(adapter, &args); @@ -252 +217 @@ -@@ -1389,7 +1403,7 @@ iavf_add_del_all_mac_addr(struct iavf_adapter *adapter, bool add) +@@ -1179,7 +1193,7 @@ iavf_add_del_all_mac_addr(struct iavf_adapter *adapter, bool add) @@ -256,2 +221,2 @@ -- err = iavf_execute_vf_cmd(adapter, &args, 0); -+ err = iavf_execute_vf_cmd_safe(adapter, &args, 0); +- err = iavf_execute_vf_cmd(adapter, &args); ++ err = iavf_execute_vf_cmd_safe(adapter, &args); @@ -261 +226 @@ -@@ -1419,7 +1433,7 @@ iavf_query_stats(struct iavf_adapter *adapter, +@@ -1206,7 +1220,7 @@ iavf_query_stats(struct iavf_adapter *adapter, @@ -265,2 +230,2 @@ -- err = iavf_execute_vf_cmd(adapter, &args, 0); -+ err = iavf_execute_vf_cmd_safe(adapter, &args, 0); +- err = iavf_execute_vf_cmd(adapter, &args); ++ err = iavf_execute_vf_cmd_safe(adapter, &args); @@ -270 +235 @@ -@@ -1457,7 +1471,7 @@ iavf_config_promisc(struct iavf_adapter *adapter, +@@ -1241,7 +1255,7 @@ iavf_config_promisc(struct iavf_adapter *adapter, @@ -274,2 +239,2 @@ -- err = iavf_execute_vf_cmd(adapter, &args, 0); -+ err = iavf_execute_vf_cmd_safe(adapter, &args, 0); +- err = iavf_execute_vf_cmd(adapter, &args); ++ err = iavf_execute_vf_cmd_safe(adapter, &args); @@ -279 +244 @@ -@@ -1500,7 +1514,7 @@ iavf_add_del_eth_addr(struct iavf_adapter *adapter, struct rte_ether_addr *addr, +@@ -1281,7 +1295,7 @@ iavf_add_del_eth_addr(struct iavf_adapter *adapter, struct rte_ether_addr *addr, @@ -283,2 +248,2 @@ -- err = iavf_execute_vf_cmd(adapter, &args, 0); -+ err = iavf_execute_vf_cmd_safe(adapter, &args, 0); +- err = iavf_execute_vf_cmd(adapter, &args); ++ err = iavf_execute_vf_cmd_safe(adapter, &args); @@ -288 +253 @@ -@@ -1527,7 +1541,7 @@ iavf_add_del_vlan(struct iavf_adapter *adapter, uint16_t vlanid, bool add) +@@ -1308,7 +1322,7 @@ iavf_add_del_vlan(struct iavf_adapter *adapter, uint16_t vlanid, bool add) @@ -292,2 +257,2 @@ -- err = iavf_execute_vf_cmd(adapter, &args, 0); -+ err = iavf_execute_vf_cmd_safe(adapter, &args, 0); +- err = iavf_execute_vf_cmd(adapter, &args); ++ err = iavf_execute_vf_cmd_safe(adapter, &args); @@ -297 +262 @@ -@@ -1554,7 +1568,7 @@ iavf_fdir_add(struct iavf_adapter *adapter, +@@ -1335,7 +1349,7 @@ iavf_fdir_add(struct iavf_adapter *adapter, @@ -301,2 +266,2 @@ -- err = iavf_execute_vf_cmd(adapter, &args, 0); -+ err = iavf_execute_vf_cmd_safe(adapter, &args, 0); +- err = iavf_execute_vf_cmd(adapter, &args); ++ err = iavf_execute_vf_cmd_safe(adapter, &args); @@ -306 +271 @@ -@@ -1614,7 +1628,7 @@ iavf_fdir_del(struct iavf_adapter *adapter, +@@ -1395,7 +1409,7 @@ iavf_fdir_del(struct iavf_adapter *adapter, @@ -310,2 +275,2 @@ -- err = iavf_execute_vf_cmd(adapter, &args, 0); -+ err = iavf_execute_vf_cmd_safe(adapter, &args, 0); +- err = iavf_execute_vf_cmd(adapter, &args); ++ err = iavf_execute_vf_cmd_safe(adapter, &args); @@ -315 +280 @@ -@@ -1661,7 +1675,7 @@ iavf_fdir_check(struct iavf_adapter *adapter, +@@ -1442,7 +1456,7 @@ iavf_fdir_check(struct iavf_adapter *adapter, @@ -319,2 +284,2 @@ -- err = iavf_execute_vf_cmd(adapter, &args, 0); -+ err = iavf_execute_vf_cmd_safe(adapter, &args, 0); +- err = iavf_execute_vf_cmd(adapter, &args); ++ err = iavf_execute_vf_cmd_safe(adapter, &args); @@ -324,28 +289 @@ -@@ -1704,7 +1718,7 @@ iavf_flow_sub(struct iavf_adapter *adapter, struct iavf_fsub_conf *filter) - args.out_buffer = vf->aq_resp; - args.out_size = IAVF_AQ_BUF_SZ; - -- err = iavf_execute_vf_cmd(adapter, &args, 0); -+ err = iavf_execute_vf_cmd_safe(adapter, &args, 0); - if (err) { - PMD_DRV_LOG(ERR, "Failed to execute command of " - "OP_FLOW_SUBSCRIBE"); -@@ -1755,7 +1769,7 @@ iavf_flow_unsub(struct iavf_adapter *adapter, struct iavf_fsub_conf *filter) - args.out_buffer = vf->aq_resp; - args.out_size = IAVF_AQ_BUF_SZ; - -- err = iavf_execute_vf_cmd(adapter, &args, 0); -+ err = iavf_execute_vf_cmd_safe(adapter, &args, 0); - if (err) { - PMD_DRV_LOG(ERR, "Failed to execute command of " - "OP_FLOW_UNSUBSCRIBE"); -@@ -1798,7 +1812,7 @@ iavf_flow_sub_check(struct iavf_adapter *adapter, - args.out_buffer = vf->aq_resp; - args.out_size = IAVF_AQ_BUF_SZ; - -- err = iavf_execute_vf_cmd(adapter, &args, 0); -+ err = iavf_execute_vf_cmd_safe(adapter, &args, 0); - if (err) { - PMD_DRV_LOG(ERR, "Failed to check flow subscription rule"); - return err; -@@ -1838,7 +1852,7 @@ iavf_add_del_rss_cfg(struct iavf_adapter *adapter, +@@ -1483,7 +1497,7 @@ iavf_add_del_rss_cfg(struct iavf_adapter *adapter, @@ -355,2 +293,2 @@ -- err = iavf_execute_vf_cmd(adapter, &args, 0); -+ err = iavf_execute_vf_cmd_safe(adapter, &args, 0); +- err = iavf_execute_vf_cmd(adapter, &args); ++ err = iavf_execute_vf_cmd_safe(adapter, &args); @@ -360,46 +298 @@ -@@ -1861,7 +1875,7 @@ iavf_get_hena_caps(struct iavf_adapter *adapter, uint64_t *caps) - args.out_buffer = vf->aq_resp; - args.out_size = IAVF_AQ_BUF_SZ; - -- err = iavf_execute_vf_cmd(adapter, &args, 0); -+ err = iavf_execute_vf_cmd_safe(adapter, &args, 0); - if (err) { - PMD_DRV_LOG(ERR, - "Failed to execute command of OP_GET_RSS_HENA_CAPS"); -@@ -1887,7 +1901,7 @@ iavf_set_hena(struct iavf_adapter *adapter, uint64_t hena) - args.out_buffer = vf->aq_resp; - args.out_size = IAVF_AQ_BUF_SZ; - -- err = iavf_execute_vf_cmd(adapter, &args, 0); -+ err = iavf_execute_vf_cmd_safe(adapter, &args, 0); - if (err) - PMD_DRV_LOG(ERR, - "Failed to execute command of OP_SET_RSS_HENA"); -@@ -1908,7 +1922,7 @@ iavf_get_qos_cap(struct iavf_adapter *adapter) - args.in_args_size = 0; - args.out_buffer = vf->aq_resp; - args.out_size = IAVF_AQ_BUF_SZ; -- err = iavf_execute_vf_cmd(adapter, &args, 0); -+ err = iavf_execute_vf_cmd_safe(adapter, &args, 0); - - if (err) { - PMD_DRV_LOG(ERR, -@@ -1941,7 +1955,7 @@ int iavf_set_q_tc_map(struct rte_eth_dev *dev, - args.out_buffer = vf->aq_resp; - args.out_size = IAVF_AQ_BUF_SZ; - -- err = iavf_execute_vf_cmd(adapter, &args, 0); -+ err = iavf_execute_vf_cmd_safe(adapter, &args, 0); - if (err) - PMD_DRV_LOG(ERR, "Failed to execute command of" - " VIRTCHNL_OP_CONFIG_TC_MAP"); -@@ -1964,7 +1978,7 @@ int iavf_set_q_bw(struct rte_eth_dev *dev, - args.out_buffer = vf->aq_resp; - args.out_size = IAVF_AQ_BUF_SZ; - -- err = iavf_execute_vf_cmd(adapter, &args, 0); -+ err = iavf_execute_vf_cmd_safe(adapter, &args, 0); - if (err) - PMD_DRV_LOG(ERR, "Failed to execute command of" - " VIRTCHNL_OP_CONFIG_QUEUE_BW"); -@@ -2009,7 +2023,7 @@ iavf_add_del_mc_addr_list(struct iavf_adapter *adapter, +@@ -1536,7 +1550,7 @@ iavf_add_del_mc_addr_list(struct iavf_adapter *adapter, @@ -409,2 +302,2 @@ -- err = iavf_execute_vf_cmd(adapter, &args, 0); -+ err = iavf_execute_vf_cmd_safe(adapter, &args, 0); +- err = iavf_execute_vf_cmd(adapter, &args); ++ err = iavf_execute_vf_cmd_safe(adapter, &args); @@ -414,25 +307,12 @@ -@@ -2053,13 +2067,17 @@ iavf_request_queues(struct rte_eth_dev *dev, uint16_t num) - if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_WB_ON_ITR) { - /* disable interrupt to avoid the admin queue message to be read - * before iavf_read_msg_from_pf. -+ * -+ * don't disable interrupt handler until ready to execute vf cmd. - */ -+ rte_spinlock_lock(&vf->aq_lock); - rte_intr_disable(pci_dev->intr_handle); - err = iavf_execute_vf_cmd(adapter, &args, 0); - rte_intr_enable(pci_dev->intr_handle); -+ rte_spinlock_unlock(&vf->aq_lock); - } else { - rte_eal_alarm_cancel(iavf_dev_alarm_handler, dev); -- err = iavf_execute_vf_cmd(adapter, &args, 0); -+ err = iavf_execute_vf_cmd_safe(adapter, &args, 0); - rte_eal_alarm_set(IAVF_ALARM_INTERVAL, - iavf_dev_alarm_handler, dev); - } -@@ -2098,7 +2116,7 @@ iavf_get_max_rss_queue_region(struct iavf_adapter *adapter) - args.out_buffer = vf->aq_resp; - args.out_size = IAVF_AQ_BUF_SZ; - -- err = iavf_execute_vf_cmd(adapter, &args, 0); -+ err = iavf_execute_vf_cmd_safe(adapter, &args, 0); +@@ -1580,10 +1594,14 @@ iavf_request_queues(struct rte_eth_dev *dev, uint16_t num) + /* + * disable interrupt to avoid the admin queue message to be read + * before iavf_read_msg_from_pf. ++ * ++ * don't disable interrupt handler until ready to execute vf cmd. + */ ++ rte_spinlock_lock(&vf->aq_lock); + rte_intr_disable(&pci_dev->intr_handle); + err = iavf_execute_vf_cmd(adapter, &args); + rte_intr_enable(&pci_dev->intr_handle); ++ rte_spinlock_unlock(&vf->aq_lock); @@ -440 +320 @@ - PMD_DRV_LOG(ERR, "Failed to execute command of VIRTCHNL_OP_GET_MAX_RSS_QREGION"); + PMD_DRV_LOG(ERR, "fail to execute command OP_REQUEST_QUEUES"); @@ -442,10 +322 @@ -@@ -2129,7 +2147,7 @@ iavf_ipsec_crypto_request(struct iavf_adapter *adapter, - args.out_buffer = vf->aq_resp; - args.out_size = IAVF_AQ_BUF_SZ; - -- err = iavf_execute_vf_cmd(adapter, &args, 1); -+ err = iavf_execute_vf_cmd_safe(adapter, &args, 1); - if (err) { - PMD_DRV_LOG(ERR, "fail to execute command %s", - "OP_INLINE_IPSEC_CRYPTO"); -@@ -2163,7 +2181,7 @@ iavf_set_vf_quanta_size(struct iavf_adapter *adapter, u16 start_queue_id, u16 nu +@@ -1618,7 +1636,7 @@ iavf_get_max_rss_queue_region(struct iavf_adapter *adapter) @@ -455,2 +326,2 @@ -- err = iavf_execute_vf_cmd(adapter, &args, 0); -+ err = iavf_execute_vf_cmd_safe(adapter, &args, 0); +- err = iavf_execute_vf_cmd(adapter, &args); ++ err = iavf_execute_vf_cmd_safe(adapter, &args); @@ -458 +329 @@ - PMD_DRV_LOG(ERR, "Failed to execute command VIRTCHNL_OP_CONFIG_QUANTA"); + PMD_DRV_LOG(ERR, "Failed to execute command of VIRTCHNL_OP_GET_MAX_RSS_QREGION"); @@ -460,18 +330,0 @@ -@@ -2189,7 +2207,7 @@ iavf_get_ptp_cap(struct iavf_adapter *adapter) - args.out_buffer = vf->aq_resp; - args.out_size = IAVF_AQ_BUF_SZ; - -- err = iavf_execute_vf_cmd(adapter, &args, 0); -+ err = iavf_execute_vf_cmd_safe(adapter, &args, 0); - if (err) { - PMD_DRV_LOG(ERR, - "Failed to execute command of OP_1588_PTP_GET_CAPS"); -@@ -2217,7 +2235,7 @@ iavf_get_phc_time(struct iavf_rx_queue *rxq) - args.out_size = IAVF_AQ_BUF_SZ; - - rte_spinlock_lock(&vf->phc_time_aq_lock); -- err = iavf_execute_vf_cmd(adapter, &args, 0); -+ err = iavf_execute_vf_cmd_safe(adapter, &args, 0); - if (err) { - PMD_DRV_LOG(ERR, - "Failed to execute command of VIRTCHNL_OP_1588_PTP_GET_TIME");