qcacmn: For me pkts, unmap buffer that holds dest mac

Before freeing me packets, the buffer holding the dest mac
address must be unmapped.

Change-Id: I551666efb0a17245d7d654cdf362a470410ceda4
This commit is contained in:
Debasis Das
2020-09-01 12:25:12 +05:30
committed by snandini
parent 2b2ff01a06
commit 721fccdad5
2 changed files with 18 additions and 1 deletions

View File

@@ -988,7 +988,8 @@ dp_tx_me_alloc_buf(struct dp_pdev *pdev)
} }
/* /*
* dp_tx_me_free_buf() - Free me descriptor and add it to pool * dp_tx_me_free_buf() - Unmap the buffer holding the dest
* address, free me descriptor and add it to the free-pool
* @pdev: DP_PDEV handle for datapath * @pdev: DP_PDEV handle for datapath
* @buf : Allocated ME BUF * @buf : Allocated ME BUF
* *
@@ -997,6 +998,20 @@ dp_tx_me_alloc_buf(struct dp_pdev *pdev)
static inline void static inline void
dp_tx_me_free_buf(struct dp_pdev *pdev, struct dp_tx_me_buf_t *buf) dp_tx_me_free_buf(struct dp_pdev *pdev, struct dp_tx_me_buf_t *buf)
{ {
/*
* If the buf containing mac address was mapped,
* it must be unmapped before freeing the me_buf.
* The "paddr_macbuf" member in the me_buf structure
* holds the mapped physical address and it must be
* set to 0 after unmapping.
*/
if (buf->paddr_macbuf) {
qdf_mem_unmap_nbytes_single(pdev->soc->osdev,
buf->paddr_macbuf,
QDF_DMA_TO_DEVICE,
QDF_MAC_ADDR_SIZE);
buf->paddr_macbuf = 0;
}
qdf_spin_lock_bh(&pdev->tx_mutex); qdf_spin_lock_bh(&pdev->tx_mutex);
buf->next = pdev->me_buf.freelist; buf->next = pdev->me_buf.freelist;
pdev->me_buf.freelist = buf; pdev->me_buf.freelist = buf;

View File

@@ -2781,12 +2781,14 @@ struct dp_invalid_peer_msg {
* dp_tx_me_buf_t: ME buffer * dp_tx_me_buf_t: ME buffer
* next: pointer to next buffer * next: pointer to next buffer
* data: Destination Mac address * data: Destination Mac address
* paddr_macbuf: physical address for dest_mac
*/ */
struct dp_tx_me_buf_t { struct dp_tx_me_buf_t {
/* Note: ME buf pool initialization logic expects next pointer to /* Note: ME buf pool initialization logic expects next pointer to
* be the first element. Dont add anything before next */ * be the first element. Dont add anything before next */
struct dp_tx_me_buf_t *next; struct dp_tx_me_buf_t *next;
uint8_t data[QDF_MAC_ADDR_SIZE]; uint8_t data[QDF_MAC_ADDR_SIZE];
qdf_dma_addr_t paddr_macbuf;
}; };
#if defined(WLAN_SUPPORT_RX_FLOW_TAG) || defined(WLAN_SUPPORT_RX_FISA) #if defined(WLAN_SUPPORT_RX_FLOW_TAG) || defined(WLAN_SUPPORT_RX_FISA)