1 From 91d510242b7aae1aff4468059840feff4075f99c Mon Sep 17 00:00:00 2001
2 From: Leyi Rong <leyi.rong@intel.com>
3 Date: Wed, 8 Apr 2020 14:22:01 +0800
4 Subject: [DPDK 08/17] net/iavf: return error if opcode is mismatched
6 Adds error return when the opcode of read message is
7 mismatched which is received from adminQ.
9 Signed-off-by: Leyi Rong <leyi.rong@intel.com>
11 drivers/net/iavf/iavf_vchnl.c | 4 +++-
12 1 file changed, 3 insertions(+), 1 deletion(-)
14 diff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c
15 index fa4da3a6d..b7fb05d32 100644
16 --- a/drivers/net/iavf/iavf_vchnl.c
17 +++ b/drivers/net/iavf/iavf_vchnl.c
18 @@ -52,9 +52,11 @@ iavf_read_msg_from_pf(struct iavf_adapter *adapter, uint16_t buf_len,
19 PMD_DRV_LOG(DEBUG, "AQ from pf carries opcode %u, retval %d",
20 opcode, vf->cmd_retval);
22 - if (opcode != vf->pend_cmd)
23 + if (opcode != vf->pend_cmd) {
24 PMD_DRV_LOG(WARNING, "command mismatch, expect %u, get %u",
25 vf->pend_cmd, opcode);
26 + return IAVF_ERR_OPCODE_MISMATCH;