net/ixgbe/base: check host interface return status
authorGuinan Sun <guinanx.sun@intel.com>
Thu, 9 Jul 2020 08:00:44 +0000 (08:00 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Sat, 11 Jul 2020 04:18:53 +0000 (06:18 +0200)
Writing to read-only fields returns a non-OK Return Status
for shadow RAM write command for X550.
This information was previously discarded.

Signed-off-by: Stanislaw Grzeszczak <stanislaw.a.grzeszczak@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
drivers/net/ixgbe/base/ixgbe_x550.c

index 318f222..8810d16 100644 (file)
@@ -3232,7 +3232,18 @@ s32 ixgbe_write_ee_hostif_data_X550(struct ixgbe_hw *hw, u16 offset,
 
        status = ixgbe_host_interface_command(hw, (u32 *)&buffer,
                                              sizeof(buffer),
-                                             IXGBE_HI_COMMAND_TIMEOUT, false);
+                                             IXGBE_HI_COMMAND_TIMEOUT, true);
+       if (status != IXGBE_SUCCESS) {
+               DEBUGOUT2("for offset %04x failed with status %d\n",
+                         offset, status);
+               return status;
+       }
+
+       if (buffer.hdr.rsp.buf_lenh_status != FW_CEM_RESP_STATUS_SUCCESS) {
+               DEBUGOUT2("for offset %04x host interface return status %02x\n",
+                         offset, buffer.hdr.rsp.buf_lenh_status);
+               return IXGBE_ERR_HOST_INTERFACE_COMMAND;
+       }
 
        return status;
 }