net/iavf: return error if opcode is mismatched
authorLeyi Rong <leyi.rong@intel.com>
Mon, 20 Apr 2020 06:16:16 +0000 (14:16 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 21 Apr 2020 11:57:09 +0000 (13:57 +0200)
Adds error return when the opcode of read message is
mismatched which is received from adminQ.

Signed-off-by: Leyi Rong <leyi.rong@intel.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
drivers/net/iavf/iavf_vchnl.c

index fa4da3a..b7fb05d 100644 (file)
@@ -52,9 +52,11 @@ iavf_read_msg_from_pf(struct iavf_adapter *adapter, uint16_t buf_len,
        PMD_DRV_LOG(DEBUG, "AQ from pf carries opcode %u, retval %d",
                    opcode, vf->cmd_retval);
 
-       if (opcode != vf->pend_cmd)
+       if (opcode != vf->pend_cmd) {
                PMD_DRV_LOG(WARNING, "command mismatch, expect %u, get %u",
                            vf->pend_cmd, opcode);
+               return IAVF_ERR_OPCODE_MISMATCH;
+       }
 
        return IAVF_SUCCESS;
 }