net/i40e: fix wrong return value when handling PF message
authorWenzhuo Lu <wenzhuo.lu@intel.com>
Wed, 21 Dec 2016 08:29:40 +0000 (16:29 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 17 Jan 2017 18:40:52 +0000 (19:40 +0100)
When VF receives a message from PF, it should check the return
value. But in i40evf_execute_vf_cmd the value is ignored and not
returned to the caller.

Fixes: 95cd21f45d1b ("i40evf: allocate virtchnl commands buffer per VF")

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
drivers/net/i40e/i40e_ethdev.h
drivers/net/i40e/i40e_ethdev_vf.c

index cbbba9f..b0363f9 100644 (file)
@@ -527,7 +527,7 @@ struct i40e_vf {
        enum i40e_aq_link_speed link_speed;
        bool vf_reset;
        volatile uint32_t pend_cmd; /* pending command not finished yet */
-       uint32_t cmd_retval; /* return value of the cmd response from PF */
+       int32_t cmd_retval; /* return value of the cmd response from PF */
        u16 pend_msg; /* flags indicates events from pf not handled yet */
        uint8_t *aq_resp; /* buffer to store the adminq response from PF */
 
index effb7a7..f50ac2d 100644 (file)
@@ -361,6 +361,7 @@ i40evf_execute_vf_cmd(struct rte_eth_dev *dev, struct vf_cmd_info *args)
                err = -1;
                do {
                        ret = i40evf_read_pfmsg(dev, &info);
+                       vf->cmd_retval = info.result;
                        if (ret == I40EVF_MSG_CMD) {
                                err = 0;
                                break;