Эх сурвалжийг харах

qcacmn: Extract tid from REO descriptor and save to skb cb

earlier we were extracting the tid from the rx tlvs, this
was in the last cache line of the 384 byte tlv. we are
extracting various fields from REO descriptor, now we are
also getting tid from the descriptor to avoid accessing
the last cache line of rx TLV there by avoiding one
cache miss per packet.

Change-Id: I1f4f12dca402604692ea374599add6763d68ab01
CRs-fixed: 2449706
Ankit Kumar 6 жил өмнө
parent
commit
e222775d39

+ 9 - 7
dp/wifi3.0/dp_rx.c

@@ -440,7 +440,7 @@ dp_rx_intrabss_fwd(struct dp_soc *soc,
 	struct dp_peer *da_peer;
 	struct dp_ast_entry *ast_entry;
 	qdf_nbuf_t nbuf_copy;
-	uint8_t tid = qdf_nbuf_get_priority(nbuf);
+	uint8_t tid = qdf_nbuf_get_tid_val(nbuf);
 	struct cdp_tid_rx_stats *tid_stats =
 		&ta_peer->vdev->pdev->stats.tid_stats.tid_rx_stats[tid];
 
@@ -1128,7 +1128,7 @@ void dp_rx_compute_delay(struct dp_vdev *vdev, qdf_nbuf_t nbuf)
 {
 	int64_t current_ts = qdf_ktime_to_ms(qdf_ktime_get());
 	uint32_t to_stack = qdf_nbuf_get_timedelta_ms(nbuf);
-	uint8_t tid = qdf_nbuf_get_priority(nbuf);
+	uint8_t tid = qdf_nbuf_get_tid_val(nbuf);
 	uint32_t interframe_delay =
 		(uint32_t)(current_ts - vdev->prev_rx_deliver_tstamp);
 
@@ -1164,7 +1164,7 @@ static inline int dp_rx_drop_nbuf_list(struct dp_pdev *pdev,
 	buf = buf_list;
 	while (buf) {
 		next_buf = qdf_nbuf_queue_next(buf);
-		tid = qdf_nbuf_get_priority(buf);
+		tid = qdf_nbuf_get_tid_val(buf);
 		stats = &pdev->stats.tid_stats.tid_rx_stats[tid];
 		stats->fail_cnt[INVALID_PEER_VDEV]++;
 		stats->delivered_to_stack--;
@@ -1427,7 +1427,7 @@ static void dp_rx_msdu_stats_update(struct dp_soc *soc,
 
 	sgi = hal_rx_msdu_start_sgi_get(rx_tlv_hdr);
 	mcs = hal_rx_msdu_start_rate_mcs_get(rx_tlv_hdr);
-	tid = hal_rx_mpdu_start_tid_get(soc->hal_soc, rx_tlv_hdr);
+	tid = qdf_nbuf_get_tid_val(nbuf);
 	bw = hal_rx_msdu_start_bw_get(rx_tlv_hdr);
 	reception_type = hal_rx_msdu_start_reception_type_get(soc->hal_soc,
 							      rx_tlv_hdr);
@@ -1888,6 +1888,9 @@ more_data:
 		if (msdu_desc_info.msdu_flags & HAL_MSDU_F_SA_IS_VALID)
 			qdf_nbuf_set_sa_valid(rx_desc->nbuf, 1);
 
+		qdf_nbuf_set_tid_val(rx_desc->nbuf,
+				     HAL_RX_REO_QUEUE_NUMBER_GET(ring_desc));
+
 		QDF_NBUF_CB_RX_PKT_LEN(rx_desc->nbuf) = msdu_desc_info.msdu_len;
 
 		QDF_NBUF_CB_RX_CTX_ID(rx_desc->nbuf) = reo_ring_num;
@@ -1949,10 +1952,9 @@ done:
 	while (nbuf) {
 		next = nbuf->next;
 		rx_tlv_hdr = qdf_nbuf_data(nbuf);
-		/* Get TID from first msdu per MPDU, save to skb->priority */
+		/* Get TID from struct cb->tid_val, save to tid */
 		if (qdf_nbuf_is_rx_chfrag_start(nbuf))
-			tid = hal_rx_mpdu_start_tid_get(soc->hal_soc,
-							rx_tlv_hdr);
+			tid = qdf_nbuf_get_tid_val(nbuf);
 
 		/*
 		 * Check if DMA completed -- msdu_done is the last bit

+ 5 - 0
hal/wifi3.0/hal_rx.h

@@ -2112,6 +2112,11 @@ enum hal_rx_reo_buf_type {
 		REO_DESTINATION_RING_7_REO_DEST_BUFFER_TYPE_MASK) >> \
 		REO_DESTINATION_RING_7_REO_DEST_BUFFER_TYPE_LSB)
 
+#define HAL_RX_REO_QUEUE_NUMBER_GET(reo_desc) (((*(((uint32_t *)reo_desc) + \
+		(REO_DESTINATION_RING_7_RECEIVE_QUEUE_NUMBER_OFFSET >> 2))) & \
+		REO_DESTINATION_RING_7_RECEIVE_QUEUE_NUMBER_MASK) >> \
+		REO_DESTINATION_RING_7_RECEIVE_QUEUE_NUMBER_LSB)
+
 /**
  * enum hal_reo_error_code: Error code describing the type of error detected
  *

+ 21 - 0
qdf/inc/qdf_nbuf.h

@@ -1237,6 +1237,27 @@ static inline int qdf_nbuf_is_raw_frame(qdf_nbuf_t buf)
 	return __qdf_nbuf_is_raw_frame(buf);
 }
 
+/**
+ * qdf_nbuf_set_tid_val() - set  tid_val
+ * @buf: Network buffer
+ * @val: 4 bits tid value
+ */
+static inline void qdf_nbuf_set_tid_val(qdf_nbuf_t buf, uint8_t val)
+{
+	__qdf_nbuf_set_tid_val(buf, val);
+}
+
+/**
+ * qdf_nbuf_get_tid_val() - get  tid_val
+ * @buf: Network buffer
+ *
+ * Return: integer value[4 bits tid value]
+ */
+static inline uint8_t qdf_nbuf_get_tid_val(qdf_nbuf_t buf)
+{
+	return __qdf_nbuf_get_tid_val(buf);
+}
+
 /**
  * qdf_nbuf_set_frag_list() - set  frag list bit
  * @buf: Network buffer

+ 13 - 1
qdf/linux/src/i_qdf_nbuf.h

@@ -151,6 +151,7 @@ typedef union {
  * @rx.ftype: mcast2ucast, TSO, SG, MESH
  * @rx.is_raw_frame: RAW frame
  * @rx.fcs_err: FCS error
+ * @rx.tid_val: tid value
  * @rx.reserved: reserved
  *
  * @tx.dev.priv_cb_w.fctx: ctx to handle special pkts defined by ftype
@@ -265,7 +266,8 @@ struct qdf_nbuf_cb {
 			uint8_t ftype;
 			uint8_t is_raw_frame:1,
 				fcs_err:1,
-				reserved:6;
+				tid_val:4,
+				reserved:2;
 		} rx;
 
 		/* Note: MAX: 40 bytes */
@@ -408,6 +410,10 @@ QDF_COMPILE_TIME_ASSERT(qdf_nbuf_cb_size,
 	(((struct qdf_nbuf_cb *) \
 	((skb)->cb))->u.rx.is_raw_frame)
 
+#define QDF_NBUF_CB_RX_TID_VAL(skb) \
+	(((struct qdf_nbuf_cb *) \
+	((skb)->cb))->u.rx.tid_val)
+
 #define QDF_NBUF_CB_RX_IS_FRAG(skb) \
 	(((struct qdf_nbuf_cb *) \
 	((skb)->cb))->u.rx.flag_is_frag)
@@ -645,6 +651,12 @@ typedef void (*qdf_nbuf_free_t)(__qdf_nbuf_t);
 #define __qdf_nbuf_is_raw_frame(skb) \
 	(QDF_NBUF_CB_RX_RAW_FRAME((skb)))
 
+#define __qdf_nbuf_get_tid_val(skb) \
+	(QDF_NBUF_CB_RX_TID_VAL((skb)))
+
+#define __qdf_nbuf_set_tid_val(skb, val) \
+	((QDF_NBUF_CB_RX_TID_VAL((skb))) = val)
+
 #define __qdf_nbuf_set_is_frag(skb, val) \
 	((QDF_NBUF_CB_RX_IS_FRAG((skb))) = val)