Ver Fonte

qcacmn: save flow related fields from TLV to SKB CB

flow related fields like flow_idx_invalid and
flow_idx_timeout are needed to send the packet
to PPE_VP hence need to be saved in SKB CB

CRs-Fixed: 3359237
Change-Id: I2166566c53641f6569f69ff316d1bafb67a828d0
Tallapragada Kalyan há 2 anos atrás
pai
commit
36ed11fcdd

+ 17 - 0
dp/wifi3.0/be/dp_be_rx.c

@@ -41,6 +41,22 @@
 #include "dp_hist.h"
 #include "dp_rx_buffer_pool.h"
 
+#ifdef WLAN_SUPPORT_RX_FLOW_TAG
+static inline void
+dp_rx_update_flow_info(qdf_nbuf_t nbuf, uint8_t *rx_tlv_hdr)
+{
+	qdf_nbuf_set_rx_flow_idx_invalid(nbuf,
+				 hal_rx_msdu_flow_idx_invalid_be(rx_tlv_hdr));
+	qdf_nbuf_set_rx_flow_idx_timeout(nbuf,
+				 hal_rx_msdu_flow_idx_invalid_be(rx_tlv_hdr));
+}
+#else
+static inline void
+dp_rx_update_flow_info(qdf_nbuf_t nbuf, uint8_t *rx_tlv_hdr)
+{
+}
+#endif
+
 #ifndef AST_OFFLOAD_ENABLE
 static void
 dp_rx_wds_learn(struct dp_soc *soc,
@@ -783,6 +799,7 @@ done:
 		}
 
 		dp_rx_cksum_offload(vdev->pdev, nbuf, rx_tlv_hdr);
+		dp_rx_update_flow_info(nbuf, rx_tlv_hdr);
 
 		if (qdf_unlikely(!rx_pdev->rx_fast_flag)) {
 			/*

+ 46 - 0
qdf/inc/i_qdf_nbuf_api_w.h

@@ -111,6 +111,52 @@ static inline uint16_t qdf_nbuf_get_rx_flow_tag(qdf_nbuf_t buf)
 	return __qdf_nbuf_get_rx_flow_tag(buf);
 }
 
+/**
+ * qdf_nbuf_set_rx_flow_idx_invalid() - set given value in flow idx invalid
+ * of buf(skb->cb)
+ * @buf: Network buffer
+ * @val: Value of Rx flow tag to be set in the nbuf
+ * Return: None
+ */
+static inline void qdf_nbuf_set_rx_flow_idx_invalid(qdf_nbuf_t buf, uint8_t val)
+{
+	__qdf_nbuf_set_rx_flow_idx_invalid(buf, val);
+}
+
+/**
+ * qdf_nbuf_get_rx_flow_idx_invalid() - Get the value of flow_idx_invalid
+ * field of buf(skb->cb)
+ * @buf: Network buffer
+ * Return: Value of the Rx flow tag in the nbuf
+ */
+static inline uint8_t qdf_nbuf_get_rx_flow_idx_invalid(qdf_nbuf_t buf)
+{
+	return __qdf_nbuf_get_rx_flow_idx_invalid(buf);
+}
+
+/**
+ * qdf_nbuf_set_rx_flow_idx_timeout() - set given value in flow idx timeout
+ * of buf(skb->cb)
+ * @buf: Network buffer
+ * @val: Value of Rx flow tag to be set in the nbuf
+ * Return: None
+ */
+static inline void qdf_nbuf_set_rx_flow_idx_timeout(qdf_nbuf_t buf, uint8_t val)
+{
+	__qdf_nbuf_set_rx_flow_idx_timeout(buf, val);
+}
+
+/**
+ * qdf_nbuf_get_rx_flow_idx_timeout() - Get the value of flow_idx_timeout
+ * field of buf(skb->cb)
+ * @buf: Network buffer
+ * Return: Value of the Rx flow idx timeout in the nbuf
+ */
+static inline uint8_t qdf_nbuf_get_rx_flow_idx_timeout(qdf_nbuf_t buf)
+{
+	return __qdf_nbuf_get_rx_flow_idx_timeout(buf);
+}
+
 /**
  * qdf_nbuf_set_exc_frame() - set exception frame flag
  * @buf: Network buffer whose cb is to set exception frame flag

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

@@ -146,6 +146,9 @@ typedef union {
  * @rx.dev.priv_cb_w.peer_id: peer_id for RX packet
  * @rx.dev.priv_cb_w.flag_intra_bss: flag to indicate this is intra bss packet
  * @rx.dev.priv_cb_w.protocol_tag: protocol tag set by app for rcvd packet type
+ * @rx.dev.priv_cb_w.flow_idx_invalid: flow entry is not found
+ * @rx.dev.priv_cb_w.flow_idx_timeout: flow entry search timed out
+ * @rx.dev.priv_cb_w.rsvd: rerserved bits
  * @rx.dev.priv_cb_w.flow_tag: flow tag set by application for 5 tuples rcvd
  *
  * @rx.dev.priv_cb_m.peer_cached_buf_frm: peer cached buffer
@@ -263,7 +266,10 @@ struct qdf_nbuf_cb {
 						 flag_intra_bss : 1,
 						 ipa_smmu_map : 1;
 					uint16_t peer_id;
-					uint16_t protocol_tag;
+					uint8_t protocol_tag;
+					uint8_t flow_idx_invalid: 1,
+						flow_idx_timeout: 1,
+						rsvd:6;
 					uint16_t flow_tag;
 				} priv_cb_w;
 				struct {

+ 20 - 0
qdf/linux/src/i_qdf_nbuf_w.h

@@ -102,6 +102,26 @@
 #define __qdf_nbuf_get_rx_flow_tag(skb) \
 		(QDF_NBUF_CB_RX_FLOW_TAG((skb)))
 
+#define QDF_NBUF_CB_RX_FLOW_IDX_INVALID(skb) \
+		(((struct qdf_nbuf_cb *) \
+		((skb)->cb))->u.rx.dev.priv_cb_w.flow_idx_invalid)
+
+#define __qdf_nbuf_set_rx_flow_idx_invalid(skb, val) \
+		((QDF_NBUF_CB_RX_FLOW_IDX_INVALID((skb))) = val)
+
+#define __qdf_nbuf_get_rx_flow_idx_invalid(skb) \
+		(QDF_NBUF_CB_RX_FLOW_IDX_INVALID((skb)))
+
+#define QDF_NBUF_CB_RX_FLOW_IDX_TIMEOUT(skb) \
+		(((struct qdf_nbuf_cb *) \
+		((skb)->cb))->u.rx.dev.priv_cb_w.flow_idx_timeout)
+
+#define __qdf_nbuf_set_rx_flow_idx_timeout(skb, val) \
+		((QDF_NBUF_CB_RX_FLOW_IDX_TIMEOUT((skb))) = val)
+
+#define __qdf_nbuf_get_rx_flow_idx_timeout(skb) \
+		(QDF_NBUF_CB_RX_FLOW_IDX_TIMEOUT((skb)))
+
 #define  QDF_NBUF_CB_RX_PACKET_IPA_SMMU_MAP(skb) \
 	 (((struct qdf_nbuf_cb *)((skb)->cb))->u.rx.dev.priv_cb_w. \
 	 ipa_smmu_map)