qcacmn: Add TX completion ring desc sanity check

Suspect HW update WBM2SW ring HP, but the ring entry contents are
not updated accordingly which then host will fetch one stale ring entry,
this makes other TX packet are freed unexpectedlly.

Add change to detect this situation earlier, if HW cookie conversion is
done, then invalidate 2nd dword for upper 32bits of VA, so next time when
reap this ring entry contents to know if this desc is updated by
HW or not. if HW cookie conversion is not done, then compare the PA in
buff_addr_info with PA in current TX desc to check.

Change-Id: I351eb4f860216fc618ff28736d4832fcec45dcc5
CRs-Fixed: 3345935
This commit is contained in:
Jinwei Chen
2022-11-30 02:14:31 -08:00
committed by Madan Koyyalamudi
parent 0456b0a11e
commit 1bf08f3566
7 changed files with 141 additions and 37 deletions

View File

@@ -49,6 +49,33 @@ struct __attribute__((__packed__)) dp_tx_comp_peer_id {
#define DP_TX_FAST_DESC_SIZE 24
#define DP_TX_L3_L4_CSUM_ENABLE 0x1f
#ifdef DP_USE_REDUCED_PEER_ID_FIELD_WIDTH
/**
* dp_tx_comp_get_peer_id_be() - Get peer ID from TX Comp Desc
* @soc: Handle to DP Soc structure
* @tx_comp_hal_desc: TX comp ring descriptor
*
* Return: Peer ID
*/
static inline uint16_t dp_tx_comp_get_peer_id_be(struct dp_soc *soc,
void *tx_comp_hal_desc)
{
uint16_t peer_id = hal_tx_comp_get_peer_id(tx_comp_hal_desc);
struct dp_tx_comp_peer_id *tx_peer_id =
(struct dp_tx_comp_peer_id *)&peer_id;
return (tx_peer_id->peer_id |
(tx_peer_id->ml_peer_valid << soc->peer_id_shift));
}
#else
static inline uint16_t dp_tx_comp_get_peer_id_be(struct dp_soc *soc,
void *tx_comp_hal_desc)
{
return hal_tx_comp_get_peer_id(tx_comp_hal_desc);
}
#endif
/**
* dp_tx_hw_enqueue_be() - Enqueue to TCL HW for transmit for BE target
* @soc: DP Soc Handle