Print this page
6064 ixgbe needs X550 support

@@ -1,8 +1,8 @@
 /******************************************************************************
 
-  Copyright (c) 2001-2012, Intel Corporation 
+  Copyright (c) 2001-2015, Intel Corporation 
   All rights reserved.
   
   Redistribution and use in source and binary forms, with or without 
   modification, are permitted provided that the following conditions are met:
   

@@ -40,11 +40,11 @@
  *  @hw: pointer to the HW structure
  *  @msg: The message buffer
  *  @size: Length of buffer
  *  @mbx_id: id of mailbox to read
  *
- *  returns SUCCESS if it successfuly read message from buffer
+ *  returns SUCCESS if it successfully read message from buffer
  **/
 s32 ixgbe_read_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size, u16 mbx_id)
 {
         struct ixgbe_mbx_info *mbx = &hw->mbx;
         s32 ret_val = IXGBE_ERR_MBX;

@@ -75,14 +75,15 @@
         struct ixgbe_mbx_info *mbx = &hw->mbx;
         s32 ret_val = IXGBE_SUCCESS;
 
         DEBUGFUNC("ixgbe_write_mbx");
 
-        if (size > mbx->size)
+        if (size > mbx->size) {
                 ret_val = IXGBE_ERR_MBX;
-
-        else if (mbx->ops.write)
+                ERROR_REPORT2(IXGBE_ERROR_ARGUMENT,
+                             "Invalid mailbox message size %d", size);
+        } else if (mbx->ops.write)
                 ret_val = mbx->ops.write(hw, msg, size, mbx_id);
 
         return ret_val;
 }
 

@@ -168,10 +169,14 @@
                 if (!countdown)
                         break;
                 usec_delay(mbx->usec_delay);
         }
 
+        if (countdown == 0)
+                ERROR_REPORT2(IXGBE_ERROR_POLLING,
+                           "Polling for VF%d mailbox message timedout", mbx_id);
+
 out:
         return countdown ? IXGBE_SUCCESS : IXGBE_ERR_MBX;
 }
 
 /**

@@ -196,10 +201,14 @@
                 if (!countdown)
                         break;
                 usec_delay(mbx->usec_delay);
         }
 
+        if (countdown == 0)
+                ERROR_REPORT2(IXGBE_ERROR_POLLING,
+                             "Polling for VF%d mailbox ack timedout", mbx_id);
+
 out:
         return countdown ? IXGBE_SUCCESS : IXGBE_ERR_MBX;
 }
 
 /**

@@ -427,16 +436,12 @@
         ret_val = ixgbe_obtain_mbx_lock_vf(hw);
         if (ret_val)
                 goto out_no_write;
 
         /* flush msg and acks as we are overwriting the message buffer */
-        ret_val = ixgbe_check_for_msg_vf(hw, 0);
-        if (ret_val)
-                goto out_no_write;
-        ret_val = ixgbe_check_for_ack_vf(hw, 0);
-        if (ret_val)
-                goto out_no_write;
+        ixgbe_check_for_msg_vf(hw, 0);
+        ixgbe_check_for_ack_vf(hw, 0);
 
         /* copy the caller specified message to the mailbox memory buffer */
         for (i = 0; i < size; i++)
                 IXGBE_WRITE_REG_ARRAY(hw, IXGBE_VFMBMEM, i, msg[i]);
 

@@ -455,11 +460,11 @@
  *  @hw: pointer to the HW structure
  *  @msg: The message buffer
  *  @size: Length of buffer
  *  @mbx_id: id of mailbox to read
  *
- *  returns SUCCESS if it successfuly read message from buffer
+ *  returns SUCCESS if it successfully read message from buffer
  **/
 static s32 ixgbe_read_mbx_vf(struct ixgbe_hw *hw, u32 *msg, u16 size,
                              u16 mbx_id)
 {
         s32 ret_val = IXGBE_SUCCESS;

@@ -598,10 +603,12 @@
 
         switch (hw->mac.type) {
         case ixgbe_mac_82599EB:
                 vflre = IXGBE_READ_REG(hw, IXGBE_VFLRE(reg_offset));
                 break;
+        case ixgbe_mac_X550:
+        case ixgbe_mac_X550EM_x:
         case ixgbe_mac_X540:
                 vflre = IXGBE_READ_REG(hw, IXGBE_VFLREC(reg_offset));
                 break;
         default:
                 break;

@@ -635,11 +642,15 @@
 
         /* reserve mailbox for vf use */
         p2v_mailbox = IXGBE_READ_REG(hw, IXGBE_PFMAILBOX(vf_number));
         if (p2v_mailbox & IXGBE_PFMAILBOX_PFU)
                 ret_val = IXGBE_SUCCESS;
+        else
+                ERROR_REPORT2(IXGBE_ERROR_POLLING,
+                           "Failed to obtain mailbox lock for VF%d", vf_number);
 
+
         return ret_val;
 }
 
 /**
  *  ixgbe_write_mbx_pf - Places a message in the mailbox

@@ -662,16 +673,12 @@
         ret_val = ixgbe_obtain_mbx_lock_pf(hw, vf_number);
         if (ret_val)
                 goto out_no_write;
 
         /* flush msg and acks as we are overwriting the message buffer */
-        ret_val = ixgbe_check_for_msg_vf(hw, 0);
-        if (ret_val)
-                goto out_no_write;
-        ret_val = ixgbe_check_for_ack_vf(hw, 0);
-        if (ret_val)
-                goto out_no_write;
+        ixgbe_check_for_msg_pf(hw, vf_number);
+        ixgbe_check_for_ack_pf(hw, vf_number);
 
         /* copy the caller specified message to the mailbox memory buffer */
         for (i = 0; i < size; i++)
                 IXGBE_WRITE_REG_ARRAY(hw, IXGBE_PFMBMEM(vf_number), i, msg[i]);
 

@@ -733,10 +740,12 @@
 void ixgbe_init_mbx_params_pf(struct ixgbe_hw *hw)
 {
         struct ixgbe_mbx_info *mbx = &hw->mbx;
 
         if (hw->mac.type != ixgbe_mac_82599EB &&
+            hw->mac.type != ixgbe_mac_X550 &&
+            hw->mac.type != ixgbe_mac_X550EM_x &&
             hw->mac.type != ixgbe_mac_X540)
                 return;
 
         mbx->timeout = 0;
         mbx->usec_delay = 0;