]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
i40evf: Use le32_to_cpu before evaluating HW desc fields.
authorTushar Dave <tushar.n.dave@oracle.com>
Mon, 1 May 2017 22:11:07 +0000 (16:11 -0600)
committerAllen Pais <allen.pais@oracle.com>
Tue, 11 Jul 2017 07:36:49 +0000 (13:06 +0530)
i40e hardware descriptor fields are in little-endian format. Driver
must use le32_to_cpu while evaluating these fields otherwise on
big-endian arch we end up evaluating incorrect values, cause errors
like:

i40evf 0001:04:02.0: Expected response 0 from PF, received 285212672
i40evf 0001:04:02.1: Expected response 0 from PF, received 285212672

Orabug: 25577233

Signed-off-by: Tushar Dave <tushar.n.dave@oracle.com>
Reviewed-by: Shannon Nelson <shannon.nelson@oracle.com>
Signed-off-by: Allen Pais <allen.pais@oracle.com>
drivers/net/ethernet/intel/i40evf/i40evf_main.c

index 182d65ffdc9f69de040f18fe2916cc19c9676e55..08ef1ce890482071dde9927dc2f3d43d7ea71817 100644 (file)
@@ -1925,8 +1925,10 @@ static void i40evf_adminq_task(struct work_struct *work)
                if (ret || !v_msg->v_opcode)
                        break; /* No event to process or error cleaning ARQ */
 
-               i40evf_virtchnl_completion(adapter, v_msg->v_opcode,
-                                          v_msg->v_retval, event.msg_buf,
+               i40evf_virtchnl_completion(adapter,
+                                          le32_to_cpu(v_msg->v_opcode),
+                                          le32_to_cpu(v_msg->v_retval),
+                                          event.msg_buf,
                                           event.msg_len);
                if (pending != 0)
                        memset(event.msg_buf, 0, I40EVF_MAX_AQ_BUF_SIZE);