mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-04 20:19:47 +08:00
ice: improve debug print for control queue messages
The ice_debug_cq function is called to print debug data for a control queue descriptor in multiple places. This includes both before we send a message on a transmit queue, after the writeback completion of a message on the transmit queue, and when we receive a message on a receive queue. This function does not include data about *which* control queue the message is on, nor whether it was what we sent to the queue or what we received from the queue. Modify ice_debug_cq to take two extra parameters, a pointer to the control queue and a boolean indicating if this was a response or a command. Improve the debug messages by replacing "CQ CMD" with a string indicating which specific control queue (based on cq->qtype) and whether this was a command sent by the PF or a response from the queue. This helps make the log output easier to understand and consume when debugging. Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com> Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha@intel.com> (A Contingent worker at Intel) Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
This commit is contained in:
parent
5f6df173f9
commit
caf4daae87
@ -887,16 +887,41 @@ static u16 ice_clean_sq(struct ice_hw *hw, struct ice_ctl_q_info *cq)
|
|||||||
return ICE_CTL_Q_DESC_UNUSED(sq);
|
return ICE_CTL_Q_DESC_UNUSED(sq);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ice_ctl_q_str - Convert control queue type to string
|
||||||
|
* @qtype: the control queue type
|
||||||
|
*
|
||||||
|
* Return: A string name for the given control queue type.
|
||||||
|
*/
|
||||||
|
static const char *ice_ctl_q_str(enum ice_ctl_q qtype)
|
||||||
|
{
|
||||||
|
switch (qtype) {
|
||||||
|
case ICE_CTL_Q_UNKNOWN:
|
||||||
|
return "Unknown CQ";
|
||||||
|
case ICE_CTL_Q_ADMIN:
|
||||||
|
return "AQ";
|
||||||
|
case ICE_CTL_Q_MAILBOX:
|
||||||
|
return "MBXQ";
|
||||||
|
case ICE_CTL_Q_SB:
|
||||||
|
return "SBQ";
|
||||||
|
default:
|
||||||
|
return "Unrecognized CQ";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ice_debug_cq
|
* ice_debug_cq
|
||||||
* @hw: pointer to the hardware structure
|
* @hw: pointer to the hardware structure
|
||||||
|
* @cq: pointer to the specific Control queue
|
||||||
* @desc: pointer to control queue descriptor
|
* @desc: pointer to control queue descriptor
|
||||||
* @buf: pointer to command buffer
|
* @buf: pointer to command buffer
|
||||||
* @buf_len: max length of buf
|
* @buf_len: max length of buf
|
||||||
|
* @response: true if this is the writeback response
|
||||||
*
|
*
|
||||||
* Dumps debug log about control command with descriptor contents.
|
* Dumps debug log about control command with descriptor contents.
|
||||||
*/
|
*/
|
||||||
static void ice_debug_cq(struct ice_hw *hw, void *desc, void *buf, u16 buf_len)
|
static void ice_debug_cq(struct ice_hw *hw, struct ice_ctl_q_info *cq,
|
||||||
|
void *desc, void *buf, u16 buf_len, bool response)
|
||||||
{
|
{
|
||||||
struct ice_aq_desc *cq_desc = desc;
|
struct ice_aq_desc *cq_desc = desc;
|
||||||
u16 len;
|
u16 len;
|
||||||
@ -910,7 +935,8 @@ static void ice_debug_cq(struct ice_hw *hw, void *desc, void *buf, u16 buf_len)
|
|||||||
|
|
||||||
len = le16_to_cpu(cq_desc->datalen);
|
len = le16_to_cpu(cq_desc->datalen);
|
||||||
|
|
||||||
ice_debug(hw, ICE_DBG_AQ_DESC, "CQ CMD: opcode 0x%04X, flags 0x%04X, datalen 0x%04X, retval 0x%04X\n",
|
ice_debug(hw, ICE_DBG_AQ_DESC, "%s %s: opcode 0x%04X, flags 0x%04X, datalen 0x%04X, retval 0x%04X\n",
|
||||||
|
ice_ctl_q_str(cq->qtype), response ? "Response" : "Command",
|
||||||
le16_to_cpu(cq_desc->opcode),
|
le16_to_cpu(cq_desc->opcode),
|
||||||
le16_to_cpu(cq_desc->flags),
|
le16_to_cpu(cq_desc->flags),
|
||||||
le16_to_cpu(cq_desc->datalen), le16_to_cpu(cq_desc->retval));
|
le16_to_cpu(cq_desc->datalen), le16_to_cpu(cq_desc->retval));
|
||||||
@ -1064,7 +1090,7 @@ ice_sq_send_cmd(struct ice_hw *hw, struct ice_ctl_q_info *cq,
|
|||||||
/* Debug desc and buffer */
|
/* Debug desc and buffer */
|
||||||
ice_debug(hw, ICE_DBG_AQ_DESC, "ATQ: Control Send queue desc and buffer:\n");
|
ice_debug(hw, ICE_DBG_AQ_DESC, "ATQ: Control Send queue desc and buffer:\n");
|
||||||
|
|
||||||
ice_debug_cq(hw, (void *)desc_on_ring, buf, buf_size);
|
ice_debug_cq(hw, cq, (void *)desc_on_ring, buf, buf_size, false);
|
||||||
|
|
||||||
(cq->sq.next_to_use)++;
|
(cq->sq.next_to_use)++;
|
||||||
if (cq->sq.next_to_use == cq->sq.count)
|
if (cq->sq.next_to_use == cq->sq.count)
|
||||||
@ -1106,7 +1132,7 @@ ice_sq_send_cmd(struct ice_hw *hw, struct ice_ctl_q_info *cq,
|
|||||||
|
|
||||||
ice_debug(hw, ICE_DBG_AQ_MSG, "ATQ: desc and buffer writeback:\n");
|
ice_debug(hw, ICE_DBG_AQ_MSG, "ATQ: desc and buffer writeback:\n");
|
||||||
|
|
||||||
ice_debug_cq(hw, (void *)desc, buf, buf_size);
|
ice_debug_cq(hw, cq, (void *)desc, buf, buf_size, true);
|
||||||
|
|
||||||
/* save writeback AQ if requested */
|
/* save writeback AQ if requested */
|
||||||
if (details->wb_desc)
|
if (details->wb_desc)
|
||||||
@ -1210,7 +1236,7 @@ ice_clean_rq_elem(struct ice_hw *hw, struct ice_ctl_q_info *cq,
|
|||||||
|
|
||||||
ice_debug(hw, ICE_DBG_AQ_DESC, "ARQ: desc and buffer:\n");
|
ice_debug(hw, ICE_DBG_AQ_DESC, "ARQ: desc and buffer:\n");
|
||||||
|
|
||||||
ice_debug_cq(hw, (void *)desc, e->msg_buf, cq->rq_buf_size);
|
ice_debug_cq(hw, cq, (void *)desc, e->msg_buf, cq->rq_buf_size, true);
|
||||||
|
|
||||||
/* Restore the original datalen and buffer address in the desc,
|
/* Restore the original datalen and buffer address in the desc,
|
||||||
* FW updates datalen to indicate the event message size
|
* FW updates datalen to indicate the event message size
|
||||||
|
Loading…
Reference in New Issue
Block a user