Skip to content

Commit 326256c

Browse files
Jakub Staniszewskianguy11
authored andcommitted
ice: reintroduce retry mechanism for indirect AQ
Add retry mechanism for indirect Admin Queue (AQ) commands. To do so we need to keep the command buffer. This technically reverts commit 43a630e ("ice: remove unused buffer copy code in ice_sq_send_cmd_retry()"), but combines it with a fix in the logic by using a kmemdup() call, making it more robust and less likely to break in the future due to programmer error. Cc: Michal Schmidt <[email protected]> Cc: [email protected] Fixes: 3056df9 ("ice: Re-send some AQ commands, as result of EBUSY AQ error") Signed-off-by: Jakub Staniszewski <[email protected]> Co-developed-by: Dawid Osuchowski <[email protected]> Signed-off-by: Dawid Osuchowski <[email protected]> Reviewed-by: Aleksandr Loktionov <[email protected]> Reviewed-by: Przemek Kitszel <[email protected]> Reviewed-by: Paul Menzel <[email protected]> Tested-by: Rinitha S <[email protected]> (A Contingent worker at Intel) Signed-off-by: Tony Nguyen <[email protected]>
1 parent eef33aa commit 326256c

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

drivers/net/ethernet/intel/ice/ice_common.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1841,6 +1841,7 @@ ice_sq_send_cmd_retry(struct ice_hw *hw, struct ice_ctl_q_info *cq,
18411841
{
18421842
struct libie_aq_desc desc_cpy;
18431843
bool is_cmd_for_retry;
1844+
u8 *buf_cpy = NULL;
18441845
u8 idx = 0;
18451846
u16 opcode;
18461847
int status;
@@ -1850,8 +1851,11 @@ ice_sq_send_cmd_retry(struct ice_hw *hw, struct ice_ctl_q_info *cq,
18501851
memset(&desc_cpy, 0, sizeof(desc_cpy));
18511852

18521853
if (is_cmd_for_retry) {
1853-
/* All retryable cmds are direct, without buf. */
1854-
WARN_ON(buf);
1854+
if (buf) {
1855+
buf_cpy = kmemdup(buf, buf_size, GFP_KERNEL);
1856+
if (!buf_cpy)
1857+
return -ENOMEM;
1858+
}
18551859

18561860
memcpy(&desc_cpy, desc, sizeof(desc_cpy));
18571861
}
@@ -1863,12 +1867,14 @@ ice_sq_send_cmd_retry(struct ice_hw *hw, struct ice_ctl_q_info *cq,
18631867
hw->adminq.sq_last_status != LIBIE_AQ_RC_EBUSY)
18641868
break;
18651869

1870+
if (buf_cpy)
1871+
memcpy(buf, buf_cpy, buf_size);
18661872
memcpy(desc, &desc_cpy, sizeof(desc_cpy));
1867-
18681873
msleep(ICE_SQ_SEND_DELAY_TIME_MS);
18691874

18701875
} while (++idx < ICE_SQ_SEND_MAX_EXECUTE);
18711876

1877+
kfree(buf_cpy);
18721878
return status;
18731879
}
18741880

0 commit comments

Comments
 (0)