Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 801739b2 authored by Linux Build Service Account's avatar Linux Build Service Account
Browse files

Merge 8545efef on remote branch

Change-Id: I06de5dfb3e203a10dab7f2f8ca4ea708af68b122
parents 9bb1549c 8545efef
Loading
Loading
Loading
Loading
+29 −0
Original line number Diff line number Diff line
@@ -301,6 +301,7 @@ QDF_STATUS __dp_rx_buffers_replenish(struct dp_soc *dp_soc, uint32_t mac_id,
		"requested %d buffers for replenish", num_req_buffers);

	hal_srng_access_start(dp_soc->hal_soc, rxdma_srng);

	num_entries_avail = hal_srng_src_num_avail(dp_soc->hal_soc,
						   rxdma_srng,
						   sync_hw_ptr);
@@ -350,6 +351,8 @@ QDF_STATUS __dp_rx_buffers_replenish(struct dp_soc *dp_soc, uint32_t mac_id,

	count = 0;

	dp_rx_refill_buff_pool_lock(dp_soc);

	while (count < num_req_buffers) {
		/* Flag is set while pdev rx_desc_pool initialization */
		if (qdf_unlikely(rx_desc_pool->rx_mon_dest_frag_enable))
@@ -406,6 +409,8 @@ QDF_STATUS __dp_rx_buffers_replenish(struct dp_soc *dp_soc, uint32_t mac_id,

	}

	dp_rx_refill_buff_pool_unlock(dp_soc);

	hal_srng_access_end(dp_soc->hal_soc, rxdma_srng);

	dp_rx_schedule_refill_thread(dp_soc);
@@ -1882,6 +1887,25 @@ QDF_STATUS dp_rx_desc_nbuf_sanity_check(hal_ring_desc_t ring_desc,

	return QDF_STATUS_E_FAILURE;
}

/**
 * dp_rx_desc_nbuf_len_sanity_check - Add sanity check to catch Rx buffer
 *				      out of bound access from H.W
 *
 * @soc: DP soc
 * @pkt_len: Packet length received from H.W
 *
 * Return: NONE
 */
static inline void
dp_rx_desc_nbuf_len_sanity_check(struct dp_soc *soc,
				 uint32_t pkt_len)
{
	struct rx_desc_pool *rx_desc_pool;

	rx_desc_pool = &soc->rx_desc_buf[0];
	qdf_assert_always(pkt_len < rx_desc_pool->buf_size);
}
#else
static inline
QDF_STATUS dp_rx_desc_nbuf_sanity_check(hal_ring_desc_t ring_desc,
@@ -1889,6 +1913,9 @@ QDF_STATUS dp_rx_desc_nbuf_sanity_check(hal_ring_desc_t ring_desc,
{
	return QDF_STATUS_SUCCESS;
}

static inline void
dp_rx_desc_nbuf_len_sanity_check(struct dp_soc *soc, uint32_t pkt_len) { }
#endif

#ifdef WLAN_FEATURE_RX_SOFTIRQ_TIME_LIMIT
@@ -2740,6 +2767,8 @@ uint32_t dp_rx_process(struct dp_intr *int_ctx, hal_ring_handle_t hal_ring_hdl,
				  msdu_metadata.l3_hdr_pad +
				  RX_PKT_TLVS_LEN;

			dp_rx_desc_nbuf_len_sanity_check(soc, pkt_len);

			qdf_nbuf_set_pktlen(nbuf, pkt_len);
			dp_rx_skip_tlvs(nbuf, msdu_metadata.l3_hdr_pad);
		}
+2 −4
Original line number Diff line number Diff line
@@ -195,15 +195,13 @@ static inline qdf_nbuf_t dp_rx_refill_buff_pool_dequeue_nbuf(struct dp_soc *soc)
	qdf_nbuf_t nbuf = NULL;
	struct rx_refill_buff_pool *buff_pool = &soc->rx_refill_buff_pool;

	if (!buff_pool->is_initialized || !buff_pool->bufq_len)
	if (!buff_pool->in_rx_refill_lock || !buff_pool->bufq_len)
		return nbuf;

	qdf_spin_lock_bh(&buff_pool->bufq_lock);
	nbuf = buff_pool->buf_head;
	buff_pool->buf_head = qdf_nbuf_next(buff_pool->buf_head);
	qdf_nbuf_set_next(nbuf, NULL);
	buff_pool->bufq_len--;
	qdf_spin_unlock_bh(&buff_pool->bufq_lock);

	return nbuf;
}
@@ -219,7 +217,7 @@ dp_rx_buffer_pool_nbuf_alloc(struct dp_soc *soc, uint32_t mac_id,
	qdf_nbuf_t nbuf;

	nbuf = dp_rx_refill_buff_pool_dequeue_nbuf(soc);
	if (nbuf) {
	if (qdf_likely(nbuf)) {
		DP_STATS_INC(dp_pdev,
			     rx_refill_buff_pool.num_bufs_allocated, 1);
		return nbuf;
+33 −0
Original line number Diff line number Diff line
@@ -109,6 +109,34 @@ static inline void dp_rx_schedule_refill_thread(struct dp_soc *soc)
		soc->cdp_soc.ol_ops->dp_rx_sched_refill_thread(dp_soc_to_cdp_soc_t(soc));
}

/**
 * dp_rx_refill_buff_pool_lock() - Acquire Rx refill buff pool lock
 * @soc: SoC handle
 *
 */
static inline void dp_rx_refill_buff_pool_lock(struct dp_soc *soc)
{
	struct rx_refill_buff_pool *buff_pool = &soc->rx_refill_buff_pool;

	if (buff_pool->is_initialized  &&
	    qdf_spin_trylock_bh(&buff_pool->bufq_lock))
		buff_pool->in_rx_refill_lock = true;
}

/**
 * dp_rx_refill_buff_pool_unlock() - Release Rx refill buff pool lock
 * @soc: SoC handle
 *
 */
static inline void dp_rx_refill_buff_pool_unlock(struct dp_soc *soc)
{
	struct rx_refill_buff_pool *buff_pool = &soc->rx_refill_buff_pool;

	if (buff_pool->in_rx_refill_lock) {
		qdf_spin_unlock_bh(&buff_pool->bufq_lock);
		buff_pool->in_rx_refill_lock = false;
	}
}
#else
/**
 * dp_rx_buffer_pool_init() - Initialize emergency buffer pool
@@ -206,5 +234,10 @@ dp_rx_buffer_pool_nbuf_map(struct dp_soc *soc,
}

static inline void dp_rx_schedule_refill_thread(struct dp_soc *soc) { }

static inline void dp_rx_refill_buff_pool_lock(struct dp_soc *soc) { }

static inline void dp_rx_refill_buff_pool_unlock(struct dp_soc *soc) { }

#endif /* WLAN_FEATURE_RX_PREALLOC_BUFFER_POOL */
#endif /* _DP_RX_BUFFER_POOL_H_ */
+2 −2
Original line number Diff line number Diff line
@@ -1728,8 +1728,8 @@ dp_rx_defrag_store_fragment(struct dp_soc *soc,

	rx_reorder_array_elem = peer->rx_tid[tid].array;
	if (!rx_reorder_array_elem) {
		QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
			  "Rcvd Fragmented pkt before peer_tid is setup");
		dp_err_rl("Rcvd Fragmented pkt before tid setup for peer %pK",
			  peer);
		goto discard_frag;
	}

+1 −0
Original line number Diff line number Diff line
@@ -1112,6 +1112,7 @@ struct rx_refill_buff_pool {
	qdf_spinlock_t bufq_lock;
	uint32_t bufq_len;
	uint32_t max_bufq_len;
	bool in_rx_refill_lock;
	bool is_initialized;
};

Loading