<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Aptos;
panose-1:2 11 0 4 2 2 2 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:12.0pt;
font-family:"Aptos",sans-serif;}
span.EmailStyle19
{mso-style-type:personal-reply;
font-family:"Aptos",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;
mso-ligatures:none;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style>
</head>
<body lang="EN-US" link="#467886" vlink="#96607D" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt">Hi <a id="OWAAM08B1FABA2D3051418205F088F8FE23A2" href="mailto:qiming.yang@intel.com">
<span style="font-family:"Aptos",sans-serif;text-decoration:none">@Qiming Yang</span></a>,
<a id="OWAAM7663F0F55D89BB468CBA9E470FDF29D5" href="mailto:jacob.e.keller@intel.com">
<span style="font-family:"Aptos",sans-serif;text-decoration:none">@Jacob Keller</span></a><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Good day!<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">I am seeing a crash in ice/base running DPDK-2111-stable. We use VPP.<br>
While looking at DPDK-emails, I see some relevant changes here.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Can you please take a look at the back-trace and suggest/point if this has been found and fixed ?<br>
<br>
(</span><span style="font-size:11.0pt;font-family:"Courier New";color:#A02B93">gdb) bt<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Courier New";color:#A02B93">#0 __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Courier New";color:#A02B93">#1 0x00007fb6f9983773 in __pthread_kill_internal (signo=6, threadid=<optimized out>) at pthread_kill.c:78<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Courier New";color:#A02B93">#2 0x00007fb6f9938876 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Courier New";color:#A02B93">#3 0x00007fb6f99237e3 in __GI_abort () at abort.c:79<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Courier New";color:#A02B93">#4 0x00000000004083fa in os_exit (code=code@entry=1) at /usr/src/debug/vpp/21.01+gitAUTOINC+fdd8bd2f89-r0/git/src/vpp/vnet/main.c:434<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Courier New";color:#A02B93">#5 0x00007fb6f9c6b8d1 in unix_signal_handler (signum=11, si=<optimized out>, uc=<optimized out>) at /usr/src/debug/vpp/21.01+gitAUTOINC+fdd8bd2f89-r0/git/src/vlib/unix/main.c:190<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Courier New";color:#A02B93">#6 <signal handler called><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Courier New";color:#A02B93">#7 0x00007fb6b37e5850 in ice_sq_send_cmd_nolock (hw=0xac0318700, cq=0xac031a1c0, desc=0x7fb6b643c5e0, buf=0xac2a78200, buf_size=6, cd=0x0) at ../git/drivers/net/ice/base/ice_controlq.c:1058<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Courier New";color:#A02B93">#8 0x00007fb6b37f428a in ice_sq_send_cmd (hw=0xac0318700, cq=0xac031a1c0, desc=0x7fb6b643c5e0, buf=0xac2a78200, buf_size=6, cd=0x0) at ../git/drivers/net/ice/base/ice_controlq.c:1126<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Courier New";color:#A02B93">#9 0x00007fb6b3824ddb in ice_sq_send_cmd_retry (hw=0xac0318700, cq=0xac031a1c0, desc=0x7fb6b643c5e0, buf=0xac2a78200, buf_size=6, cd=0x0) at ../git/drivers/net/ice/base/ice_common.c:1729<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Courier New";color:#A02B93">#10 0x00007fb6b38335ee in ice_aq_send_cmd (hw=0xac0318700, desc=0x7fb6b643c5e0, buf=0xac2a78200, buf_size=6, cd=0x0) at ../git/drivers/net/ice/base/ice_common.c:1788<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Courier New";color:#A02B93">#11 0x00007fb6b3833fca in ice_aq_alloc_free_res (hw=0xac0318700, num_entries=1, buf=0xac2a78200, buf_size=6, opc=ice_aqc_opc_alloc_res, cd=0x0) at ../git/drivers/net/ice/base/ice_common.c:2124<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Courier New";color:#A02B93">#12 0x00007fb6b38340a1 in ice_alloc_hw_res (hw=0xac0318700, type=96, num=1, btm=false, res=0x7fb6b643f348) at ../git/drivers/net/ice/base/ice_common.c:2154<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Courier New";color:#A02B93">#13 0x00007fb6b39e25e8 in ice_alloc_prof_id (hw=0xac0318700, blk=ICE_BLK_RSS, prof_id=0x7fb6b643f39f "") at ../git/drivers/net/ice/base/ice_flex_pipe.c:3309<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Courier New";color:#A02B93">#14 0x00007fb6b3a03659 in ice_add_prof (hw=0xac0318700, blk=ICE_BLK_RSS, id=17179875328, ptypes=0xac2a790fc "", attr=0x0, attr_cnt=0, es=0xac2a78fd0, masks=0xac2a7909a,
fd_swap=true)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Courier New";color:#A02B93"> at ../git/drivers/net/ice/base/ice_flex_pipe.c:5028<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Courier New";color:#A02B93">#15 0x00007fb6b3a20210 in ice_flow_add_prof_sync (hw=0xac0318700, blk=ICE_BLK_RSS, dir=ICE_FLOW_RX, prof_id=17179875328, segs=0xac2a79200, segs_cnt=1 '\001', acts=0x0,
acts_cnt=0 '\000', <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Courier New";color:#A02B93"> prof=0x7fb6b6444f10) at ../git/drivers/net/ice/base/ice_flow.c:2245<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Courier New";color:#A02B93">#16 0x00007fb6b3a20f9a in ice_flow_add_prof (hw=0xac0318700, blk=ICE_BLK_RSS, dir=ICE_FLOW_RX, prof_id=17179875328, segs=0xac2a79200, segs_cnt=1 '\001', acts=0x0, acts_cnt=0
'\000', <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Courier New";color:#A02B93"> prof=0x7fb6b6444f10) at ../git/drivers/net/ice/base/ice_flow.c:2646<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Courier New";color:#A02B93">#17 0x00007fb6b3a483af in ice_add_rss_cfg_sync (hw=0xac0318700, vsi_handle=0, cfg=0x7fb6b6444f60) at ../git/drivers/net/ice/base/ice_flow.c:4276<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Courier New";color:#A02B93">#18 0x00007fb6b3a48503 in ice_add_rss_cfg (hw=0xac0318700, vsi_handle=0, cfg=0x7fb6b6444fe0) at ../git/drivers/net/ice/base/ice_flow.c:4329<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Courier New";color:#A02B93">#19 0x00007fb6b3c18577 in ice_add_rss_cfg_wrap (pf=0xac031b718, vsi_id=0, cfg=0x7fb6b6444fe0) at ../git/drivers/net/ice/ice_ethdev.c:2998<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Courier New";color:#A02B93">#20 0x00007fb6b3c186cc in ice_rss_hash_set (pf=0xac031b718, rss_hf=12220) at ../git/drivers/net/ice/ice_ethdev.c:3038<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Courier New";color:#A02B93">#21 0x00007fb6b3c2eba9 in ice_init_rss (pf=0xac031b718) at ../git/drivers/net/ice/ice_ethdev.c:3289<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Courier New";color:#A02B93">#22 0x00007fb6b3c2eccd in ice_dev_configure (dev=0x7fb6b8dc04c0 <rte_eth_devices>) at ../git/drivers/net/ice/ice_ethdev.c:3323<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Courier New";color:#A02B93">#23 0x00007fb6b8ca82a3 in rte_eth_dev_configure (port_id=0, nb_rx_q=2, nb_tx_q=3, dev_conf=0x7fb6bbde3820) at ../git/lib/ethdev/rte_ethdev.c:1633<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Courier New";color:#A02B93">#24 0x00007fb6b8fb7fef in dpdk_device_setup (xd=xd@entry=0x7fb6bbde37c0) at /usr/src/debug/vpp/21.01+gitAUTOINC+fdd8bd2f89-r0/git/src/plugins/dpdk/device/common.c:92<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Courier New";color:#A02B93">#25 0x00007fb6b8fcbe37 in dpdk_lib_init (dm=0x7fb6b901d260 <dpdk_main>) at /usr/src/debug/vpp/21.01+gitAUTOINC+fdd8bd2f89-r0/git/src/plugins/dpdk/device/init.c:759<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Courier New";color:#A02B93">#26 0x00007fb6b8fd0936 in dpdk_process (vm=0x4aef40 <vlib_global_main>, rt=<optimized out>, f=<optimized out>)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Courier New";color:#A02B93"> at /usr/src/debug/vpp/21.01+gitAUTOINC+fdd8bd2f89-r0/git/src/plugins/dpdk/device/init.c:1684<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Courier New";color:#A02B93">#27 0x00007fb6f9c1c7b7 in vlib_process_bootstrap (_a=<optimized out>) at /usr/src/debug/vpp/21.01+gitAUTOINC+fdd8bd2f89-r0/git/src/vlib/main.c:1477<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Courier New";color:#A02B93">#28 0x00007fb6f9b24ea8 in clib_calljmp () at /usr/src/debug/vpp/21.01+gitAUTOINC+fdd8bd2f89-r0/git/src/vppinfra/longjmp.S:123<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Courier New";color:#A02B93">#29 0x00007fb6b8656d10 in ?? ()<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Courier New";color:#A02B93">#30 0x00007fb6f9c2075c in vlib_process_startup (f=0x0, p=0x7fb6b966e080, vm=0x4aef40 <vlib_global_main>) at /usr/src/debug/vpp/21.01+gitAUTOINC+fdd8bd2f89-r0/git/src/vlib/main.c:1502<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Courier New";color:#A02B93">#31 dispatch_process (vm=0x4aef40 <vlib_global_main>, p=0x7fb6b966e080, last_time_stamp=<optimized out>, f=0x0) at /usr/src/debug/vpp/21.01+gitAUTOINC+fdd8bd2f89-r0/git/src/vlib/main.c:1558<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Courier New";color:#A02B93">#32 0x0000000000000000 in ?? ()<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Thanks,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Leela sankar<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<div id="mail-editor-reference-message-container">
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="margin-bottom:12.0pt"><b><span style="color:black">From:
</span></b><span style="color:black">Qiming Yang <qiming.yang@intel.com><br>
<b>Date: </b>Thursday, April 27, 2023 at 1:38 AM<br>
<b>To: </b>dev@dpdk.org <dev@dpdk.org><br>
<b>Cc: </b>qi.z.zhang@intel.com <qi.z.zhang@intel.com>, Qiming Yang <qiming.yang@intel.com>, Jacob Keller <jacob.e.keller@intel.com><br>
<b>Subject: </b>[**EXTERNAL**] [PATCH 03/30] net/ice/base: remove unnecessary control queue array<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="font-size:11.0pt">The driver allocates a cmd_buf array in addition to the desc_buf array.<br>
This array stores an ice_sq_cd command details structure for each entry in<br>
the control queue ring. And improve debug print for control queue messages.<br>
<br>
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com><br>
Signed-off-by: Qiming Yang <qiming.yang@intel.com><br>
---<br>
drivers/net/ice/base/ice_controlq.c | 107 +++++++++++++++-------------<br>
drivers/net/ice/base/ice_controlq.h | 3 -<br>
2 files changed, 56 insertions(+), 54 deletions(-)<br>
<br>
diff --git a/drivers/net/ice/base/ice_controlq.c b/drivers/net/ice/base/ice_controlq.c<br>
index c34407b48c..acd6ad249b 100644<br>
--- a/drivers/net/ice/base/ice_controlq.c<br>
+++ b/drivers/net/ice/base/ice_controlq.c<br>
@@ -101,13 +101,6 @@ ice_alloc_ctrlq_sq_ring(struct ice_hw *hw, struct ice_ctl_q_info *cq)<br>
if (!cq->sq.desc_buf.va)<br>
return ICE_ERR_NO_MEMORY;<br>
<br>
- cq->sq.cmd_buf = ice_calloc(hw, cq->num_sq_entries,<br>
- sizeof(struct ice_sq_cd));<br>
- if (!cq->sq.cmd_buf) {<br>
- ice_free_dma_mem(hw, &cq->sq.desc_buf);<br>
- return ICE_ERR_NO_MEMORY;<br>
- }<br>
-<br>
return ICE_SUCCESS;<br>
}<br>
<br>
@@ -176,7 +169,7 @@ ice_alloc_rq_bufs(struct ice_hw *hw, struct ice_ctl_q_info *cq)<br>
if (cq->rq_buf_size > ICE_AQ_LG_BUF)<br>
desc->flags |= CPU_TO_LE16(ICE_AQ_FLAG_LB);<br>
desc->opcode = 0;<br>
- /* This is in accordance with Admin queue design, there is no<br>
+ /* This is in accordance with control queue design, there is no<br>
* register for buffer size configuration<br>
*/<br>
desc->datalen = CPU_TO_LE16(bi->size);<br>
@@ -309,9 +302,6 @@ do { \<br>
ice_free_dma_mem((hw), \<br>
&(qi)->ring.r.ring##_bi[i]); \<br>
} \<br>
- /* free the buffer info list */ \<br>
- if ((qi)->ring.cmd_buf) \<br>
- ice_free(hw, (qi)->ring.cmd_buf); \<br>
/* free DMA head */ \<br>
ice_free(hw, (qi)->ring.dma_head); \<br>
} while (0)<br>
@@ -379,11 +369,11 @@ static enum ice_status ice_init_sq(struct ice_hw *hw, struct ice_ctl_q_info *cq)<br>
}<br>
<br>
/**<br>
- * ice_init_rq - initialize ARQ<br>
+ * ice_init_rq - initialize receive side of a control queue<br>
* @hw: pointer to the hardware structure<br>
* @cq: pointer to the specific Control queue<br>
*<br>
- * The main initialization routine for the Admin Receive (Event) Queue.<br>
+ * The main initialization routine for Receive side of a control queue.<br>
* Prior to calling this function, the driver *MUST* set the following fields<br>
* in the cq->structure:<br>
* - cq->num_rq_entries<br>
@@ -441,7 +431,7 @@ static enum ice_status ice_init_rq(struct ice_hw *hw, struct ice_ctl_q_info *cq)<br>
}<br>
<br>
/**<br>
- * ice_shutdown_sq - shutdown the Control ATQ<br>
+ * ice_shutdown_sq - shutdown the transmit side of a control queue<br>
* @hw: pointer to the hardware structure<br>
* @cq: pointer to the specific Control queue<br>
*<br>
@@ -461,7 +451,7 @@ ice_shutdown_sq(struct ice_hw *hw, struct ice_ctl_q_info *cq)<br>
goto shutdown_sq_out;<br>
}<br>
<br>
- /* Stop firmware AdminQ processing */<br>
+ /* Stop processing of the control queue */<br>
wr32(hw, cq->sq.head, 0);<br>
wr32(hw, cq->sq.tail, 0);<br>
wr32(hw, cq->sq.len, 0);<br>
@@ -834,7 +824,7 @@ void ice_destroy_all_ctrlq(struct ice_hw *hw)<br>
}<br>
<br>
/**<br>
- * ice_clean_sq - cleans Admin send queue (ATQ)<br>
+ * ice_clean_sq - cleans send side of a control queue<br>
* @hw: pointer to the hardware structure<br>
* @cq: pointer to the specific Control queue<br>
*<br>
@@ -844,21 +834,17 @@ static u16 ice_clean_sq(struct ice_hw *hw, struct ice_ctl_q_info *cq)<br>
{<br>
struct ice_ctl_q_ring *sq = &cq->sq;<br>
u16 ntc = sq->next_to_clean;<br>
- struct ice_sq_cd *details;<br>
struct ice_aq_desc *desc;<br>
<br>
desc = ICE_CTL_Q_DESC(*sq, ntc);<br>
- details = ICE_CTL_Q_DETAILS(*sq, ntc);<br>
<br>
while (rd32(hw, cq->sq.head) != ntc) {<br>
ice_debug(hw, ICE_DBG_AQ_MSG, "ntc %d head %d.\n", ntc, rd32(hw, cq->sq.head));<br>
ice_memset(desc, 0, sizeof(*desc), ICE_DMA_MEM);<br>
- ice_memset(details, 0, sizeof(*details), ICE_NONDMA_MEM);<br>
ntc++;<br>
if (ntc == sq->count)<br>
ntc = 0;<br>
desc = ICE_CTL_Q_DESC(*sq, ntc);<br>
- details = ICE_CTL_Q_DETAILS(*sq, ntc);<br>
}<br>
<br>
sq->next_to_clean = ntc;<br>
@@ -866,16 +852,42 @@ static u16 ice_clean_sq(struct ice_hw *hw, struct ice_ctl_q_info *cq)<br>
return ICE_CTL_Q_DESC_UNUSED(sq);<br>
}<br>
<br>
+/**<br>
+ * ice_ctl_q_str - Convert control queue type to string<br>
+ * @qtype: the control queue type<br>
+ *<br>
+ * Returns: A string name for the given control queue type.<br>
+ */<br>
+static const char *ice_ctl_q_str(enum ice_ctl_q qtype)<br>
+{<br>
+ switch (qtype) {<br>
+ case ICE_CTL_Q_UNKNOWN:<br>
+ return "Unknown CQ";<br>
+ case ICE_CTL_Q_ADMIN:<br>
+ return "AQ";<br>
+ case ICE_CTL_Q_MAILBOX:<br>
+ return "MBXQ";<br>
+ case ICE_CTL_Q_SB:<br>
+ return "SBQ";<br>
+ default:<br>
+ return "Unrecognized CQ";<br>
+ }<br>
+}<br>
+<br>
/**<br>
* ice_debug_cq<br>
* @hw: pointer to the hardware structure<br>
+ * @cq: pointer to the specific Control queue<br>
* @desc: pointer to control queue descriptor<br>
* @buf: pointer to command buffer<br>
* @buf_len: max length of buf<br>
+ * @response: true if this is the writeback response<br>
*<br>
* Dumps debug log about control command with descriptor contents.<br>
*/<br>
-static void ice_debug_cq(struct ice_hw *hw, void *desc, void *buf, u16 buf_len)<br>
+static void<br>
+ice_debug_cq(struct ice_hw *hw, struct ice_ctl_q_info *cq,<br>
+ void *desc, void *buf, u16 buf_len, bool response)<br>
{<br>
struct ice_aq_desc *cq_desc = (struct ice_aq_desc *)desc;<br>
u16 datalen, flags;<br>
@@ -889,7 +901,8 @@ static void ice_debug_cq(struct ice_hw *hw, void *desc, void *buf, u16 buf_len)<br>
datalen = LE16_TO_CPU(cq_desc->datalen);<br>
flags = LE16_TO_CPU(cq_desc->flags);<br>
<br>
- ice_debug(hw, ICE_DBG_AQ_DESC, "CQ CMD: opcode 0x%04X, flags 0x%04X, datalen 0x%04X, retval 0x%04X\n",<br>
+ ice_debug(hw, ICE_DBG_AQ_DESC, "%s %s: opcode 0x%04X, flags 0x%04X, datalen 0x%04X, retval 0x%04X\n",<br>
+ ice_ctl_q_str(cq->qtype), response ? "Response" : "Command",<br>
LE16_TO_CPU(cq_desc->opcode), flags, datalen,<br>
LE16_TO_CPU(cq_desc->retval));<br>
ice_debug(hw, ICE_DBG_AQ_DESC, "\tcookie (h,l) 0x%08X 0x%08X\n",<br>
@@ -914,23 +927,23 @@ static void ice_debug_cq(struct ice_hw *hw, void *desc, void *buf, u16 buf_len)<br>
}<br>
<br>
/**<br>
- * ice_sq_done - check if FW has processed the Admin Send Queue (ATQ)<br>
+ * ice_sq_done - check if the last send on a control queue has completed<br>
* @hw: pointer to the HW struct<br>
* @cq: pointer to the specific Control queue<br>
*<br>
- * Returns true if the firmware has processed all descriptors on the<br>
- * admin send queue. Returns false if there are still requests pending.<br>
+ * Returns: true if all the descriptors on the send side of a control queue<br>
+ * are finished processing, false otherwise.<br>
*/<br>
static bool ice_sq_done(struct ice_hw *hw, struct ice_ctl_q_info *cq)<br>
{<br>
- /* AQ designers suggest use of head for better<br>
+ /* control queue designers suggest use of head for better<br>
* timing reliability than DD bit<br>
*/<br>
return rd32(hw, cq->sq.head) == cq->sq.next_to_use;<br>
}<br>
<br>
/**<br>
- * ice_sq_send_cmd_nolock - send command to Control Queue (ATQ)<br>
+ * ice_sq_send_cmd_nolock - send command to a control queue<br>
* @hw: pointer to the HW struct<br>
* @cq: pointer to the specific Control queue<br>
* @desc: prefilled descriptor describing the command (non DMA mem)<br>
@@ -938,8 +951,9 @@ static bool ice_sq_done(struct ice_hw *hw, struct ice_ctl_q_info *cq)<br>
* @buf_size: size of buffer for indirect commands (or 0 for direct commands)<br>
* @cd: pointer to command details structure<br>
*<br>
- * This is the main send command routine for the ATQ. It runs the queue,<br>
- * cleans the queue, etc.<br>
+ * This is the main send command routine for a control queue. It prepares the<br>
+ * command into a descriptor, bumps the send queue tail, waits for the command<br>
+ * to complete, captures status and data for the command, etc.<br>
*/<br>
enum ice_status<br>
ice_sq_send_cmd_nolock(struct ice_hw *hw, struct ice_ctl_q_info *cq,<br>
@@ -950,7 +964,6 @@ ice_sq_send_cmd_nolock(struct ice_hw *hw, struct ice_ctl_q_info *cq,<br>
struct ice_aq_desc *desc_on_ring;<br>
bool cmd_completed = false;<br>
enum ice_status status = ICE_SUCCESS;<br>
- struct ice_sq_cd *details;<br>
u32 total_delay = 0;<br>
u16 retval = 0;<br>
u32 val = 0;<br>
@@ -993,12 +1006,6 @@ ice_sq_send_cmd_nolock(struct ice_hw *hw, struct ice_ctl_q_info *cq,<br>
goto sq_send_command_error;<br>
}<br>
<br>
- details = ICE_CTL_Q_DETAILS(cq->sq, cq->sq.next_to_use);<br>
- if (cd)<br>
- *details = *cd;<br>
- else<br>
- ice_memset(details, 0, sizeof(*details), ICE_NONDMA_MEM);<br>
-<br>
/* Call clean and check queue available function to reclaim the<br>
* descriptors that were processed by FW/MBX; the function returns the<br>
* number of desc available. The clean function called here could be<br>
@@ -1035,8 +1042,7 @@ ice_sq_send_cmd_nolock(struct ice_hw *hw, struct ice_ctl_q_info *cq,<br>
<br>
/* Debug desc and buffer */<br>
ice_debug(hw, ICE_DBG_AQ_DESC, "ATQ: Control Send queue desc and buffer:\n");<br>
-<br>
- ice_debug_cq(hw, (void *)desc_on_ring, buf, buf_size);<br>
+ ice_debug_cq(hw, cq, (void *)desc_on_ring, buf, buf_size, false);<br>
<br>
(cq->sq.next_to_use)++;<br>
if (cq->sq.next_to_use == cq->sq.count)<br>
@@ -1084,13 +1090,12 @@ ice_sq_send_cmd_nolock(struct ice_hw *hw, struct ice_ctl_q_info *cq,<br>
}<br>
<br>
ice_debug(hw, ICE_DBG_AQ_MSG, "ATQ: desc and buffer writeback:\n");<br>
-<br>
- ice_debug_cq(hw, (void *)desc, buf, buf_size);<br>
+ ice_debug_cq(hw, cq, (void *)desc, buf, buf_size, true);<br>
<br>
/* save writeback AQ if requested */<br>
- if (details->wb_desc)<br>
- ice_memcpy(details->wb_desc, desc_on_ring,<br>
- sizeof(*details->wb_desc), ICE_DMA_TO_NONDMA);<br>
+ if (cd && cd->wb_desc)<br>
+ ice_memcpy(cd->wb_desc, desc_on_ring,<br>
+ sizeof(*cd->wb_desc), ICE_DMA_TO_NONDMA);<br>
<br>
/* update the error if time out occurred */<br>
if (!cmd_completed) {<br>
@@ -1109,7 +1114,7 @@ ice_sq_send_cmd_nolock(struct ice_hw *hw, struct ice_ctl_q_info *cq,<br>
}<br>
<br>
/**<br>
- * ice_sq_send_cmd - send command to Control Queue (ATQ)<br>
+ * ice_sq_send_cmd - send command to a control queue<br>
* @hw: pointer to the HW struct<br>
* @cq: pointer to the specific Control queue<br>
* @desc: prefilled descriptor describing the command<br>
@@ -1117,8 +1122,9 @@ ice_sq_send_cmd_nolock(struct ice_hw *hw, struct ice_ctl_q_info *cq,<br>
* @buf_size: size of buffer for indirect commands (or 0 for direct commands)<br>
* @cd: pointer to command details structure<br>
*<br>
- * This is the main send command routine for the ATQ. It runs the queue,<br>
- * cleans the queue, etc.<br>
+ * Main command for the transmit side of a control queue. It puts the command<br>
+ * on the queue, bumps the tail, waits for processing of the command, captures<br>
+ * command status and results, etc.<br>
*/<br>
enum ice_status<br>
ice_sq_send_cmd(struct ice_hw *hw, struct ice_ctl_q_info *cq,<br>
@@ -1160,9 +1166,9 @@ void ice_fill_dflt_direct_cmd_desc(struct ice_aq_desc *desc, u16 opcode)<br>
* @e: event info from the receive descriptor, includes any buffers<br>
* @pending: number of events that could be left to process<br>
*<br>
- * This function cleans one Admin Receive Queue element and returns<br>
- * the contents through e. It can also return how many events are<br>
- * left to process through 'pending'.<br>
+ * Clean one element from the receive side of a control queue. On return 'e'<br>
+ * contains contents of the message, and 'pending' contains the number of<br>
+ * events left to process.<br>
*/<br>
enum ice_status<br>
ice_clean_rq_elem(struct ice_hw *hw, struct ice_ctl_q_info *cq,<br>
@@ -1218,8 +1224,7 @@ ice_clean_rq_elem(struct ice_hw *hw, struct ice_ctl_q_info *cq,<br>
e->msg_len, ICE_DMA_TO_NONDMA);<br>
<br>
ice_debug(hw, ICE_DBG_AQ_DESC, "ARQ: desc and buffer:\n");<br>
-<br>
- ice_debug_cq(hw, (void *)desc, e->msg_buf, cq->rq_buf_size);<br>
+ ice_debug_cq(hw, cq, (void *)desc, e->msg_buf, cq->rq_buf_size, true);<br>
<br>
/* Restore the original datalen and buffer address in the desc,<br>
* FW updates datalen to indicate the event message size<br>
diff --git a/drivers/net/ice/base/ice_controlq.h b/drivers/net/ice/base/ice_controlq.h<br>
index 986604ec3c..5c60469693 100644<br>
--- a/drivers/net/ice/base/ice_controlq.h<br>
+++ b/drivers/net/ice/base/ice_controlq.h<br>
@@ -43,7 +43,6 @@ enum ice_ctl_q {<br>
struct ice_ctl_q_ring {<br>
void *dma_head; /* Virtual address to DMA head */<br>
struct ice_dma_mem desc_buf; /* descriptor ring memory */<br>
- void *cmd_buf; /* command buffer memory */<br>
<br>
union {<br>
struct ice_dma_mem *sq_bi;<br>
@@ -73,8 +72,6 @@ struct ice_sq_cd {<br>
struct ice_aq_desc *wb_desc;<br>
};<br>
<br>
-#define ICE_CTL_Q_DETAILS(R, i) (&(((struct ice_sq_cd *)((R).cmd_buf))[i]))<br>
-<br>
/* rq event information */<br>
struct ice_rq_event_info {<br>
struct ice_aq_desc desc;<br>
-- <br>
2.25.1<o:p></o:p></span></p>
</div>
</div>
</div>
</div>
</body>
</html>