Prechádzať zdrojové kódy

qcacmn: Add Video/all TID Counters framework for both tx/rx

Add struct in cdp required to display VoW stats
for hawkeye and akronite

Change-Id: Ibd3a3b5e5933841cc28c9ce1b36d69615234720a
Pranita Solanke 6 rokov pred
rodič
commit
afcd0f1289

+ 31 - 0
dp/inc/cdp_txrx_cmn.h

@@ -1738,6 +1738,37 @@ cdp_pdev_set_ctrl_pdev(ol_txrx_soc_handle soc, struct cdp_pdev *dp_pdev,
 							       ctrl_pdev);
 }
 
+/* cdp_txrx_classify_and_update() - To classify the packet and update stats
+ * @soc: opaque soc handle
+ * @vdev: opaque dp vdev handle
+ * @skb: data
+ * @dir: rx or tx packet
+ * @nbuf_classify: packet classification object
+ *
+ * Return: 1 on success else return 0
+ */
+static inline int
+cdp_txrx_classify_and_update(ol_txrx_soc_handle soc,
+			     struct cdp_vdev *vdev, qdf_nbuf_t skb,
+			     enum txrx_direction dir,
+			     struct ol_txrx_nbuf_classify *nbuf_class)
+{
+	if (!soc || !soc->ops) {
+		QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
+			  "%s: Invalid Instance", __func__);
+		QDF_BUG(0);
+		return 0;
+	}
+
+	if (!soc->ops->cmn_drv_ops ||
+	    !soc->ops->cmn_drv_ops->txrx_classify_update)
+		return 0;
+
+	return soc->ops->cmn_drv_ops->txrx_classify_update(vdev,
+							   skb,
+							   dir, nbuf_class);
+}
+
 #ifdef RECEIVE_OFFLOAD
 /**
  * cdp_register_rx_offld_flush_cb() - register LRO/GRO flush cb function pointer

+ 46 - 2
dp/inc/cdp_txrx_cmn_struct.h

@@ -360,6 +360,52 @@ typedef struct cdp_soc_t *ol_txrx_soc_handle;
  */
 typedef void (*ol_txrx_vdev_delete_cb)(void *context);
 
+/**
+ * ol_txrx_pkt_direction - Packet Direction
+ * @rx_direction: rx path packet
+ * @tx_direction: tx path packet
+ */
+enum txrx_direction {
+	rx_direction = 1,
+	tx_direction = 0,
+};
+
+/**
+ * ol_txrx_nbuf_classify - Packet classification object
+ * @peer_id: unique peer identifier from fw
+ * @tid: traffic identifier(could be overridden)
+ * @pkt_tid: traffic identifier(cannot be overridden)
+ * @pkt_tos: ip header tos value
+ * @pkt_dscp: ip header dscp value
+ * @tos: index value in map
+ * @dscp: DSCP_TID map index
+ * @is_mcast: multicast pkt check
+ * @is_eap: eapol pkt check
+ * @is_arp: arp pkt check
+ * @is_tcp: tcp pkt check
+ * @is_dhcp: dhcp pkt check
+ * @is_igmp: igmp pkt check
+ * @is_ipv4: ip version 4 pkt check
+ * @is_ipv6: ip version 6 pkt check
+ */
+struct ol_txrx_nbuf_classify {
+	uint16_t peer_id;
+	uint8_t tid;
+	uint8_t pkt_tid;
+	uint8_t pkt_tos;
+	uint8_t pkt_dscp;
+	uint8_t tos;
+	uint8_t dscp;
+	uint8_t is_mcast;
+	uint8_t is_eap;
+	uint8_t is_arp;
+	uint8_t is_tcp;
+	uint8_t is_dhcp;
+	uint8_t is_igmp;
+	uint8_t is_ipv4;
+	uint8_t is_ipv6;
+};
+
 /**
  * ol_osif_vdev_handle - paque handle for OS shim virtual device
  * object
@@ -625,7 +671,6 @@ struct ol_txrx_ops {
 		ol_txrx_stats_rx_fp           stats_rx;
 		ol_txrx_rsim_rx_decap_fp rsim_rx_decap;
 	} rx;
-
 	/* proxy arp function pointer - specified by OS shim, stored by txrx */
 	ol_txrx_proxy_arp_fp      proxy_arp;
 	ol_txrx_mcast_me_fp          me_convert;
@@ -758,7 +803,6 @@ enum cdp_vdev_param_type {
 
 #define PER_RADIO_FW_STATS_REQUEST 0
 #define PER_VDEV_FW_STATS_REQUEST 1
-
 /**
  * enum data_stall_log_event_indicator - Module triggering data stall
  * @DATA_STALL_LOG_INDICATOR_UNUSED: Unused

+ 3 - 1
dp/inc/cdp_txrx_ops.h

@@ -337,7 +337,6 @@ struct cdp_cmn_ops {
 					struct cdp_ctrl_objmgr_pdev *ctrl_pdev);
 
 	ol_txrx_tx_fp tx_send;
-
 	/**
 	 * txrx_get_os_rx_handles_from_vdev() - Return function, osif vdev
 	 *					to deliver pkt to stack.
@@ -349,6 +348,9 @@ struct cdp_cmn_ops {
 					(struct cdp_vdev *vdev,
 					 ol_txrx_rx_fp *stack_fn,
 					 ol_osif_vdev_handle *osif_vdev);
+	int (*txrx_classify_update)
+		(struct cdp_vdev *vdev, qdf_nbuf_t skb,
+		 enum txrx_direction, struct ol_txrx_nbuf_classify *nbuf_class);
 };
 
 struct cdp_ctrl_ops {

+ 69 - 0
dp/inc/cdp_txrx_stats_struct.h

@@ -62,6 +62,31 @@
 
 #define CDP_MAX_RX_RINGS 4
 
+/* TID level VoW stats macros
+ * to add and get stats
+ */
+#define PFLOW_TXRX_TIDQ_STATS_ADD(_peer, _tid, _var, _val) \
+	(((_peer)->tidq_stats[_tid]).stats[_var]) += _val
+#define PFLOW_TXRX_TIDQ_STATS_GET(_peer, _tid, _var, _val) \
+	((_peer)->tidq_stats[_tid].stats[_var])
+/*
+ * Video only stats
+ */
+#define PFLOW_CTRL_PDEV_VIDEO_STATS_SET(_pdev, _var, _val) \
+	(((_pdev)->vow.vistats[_var]).value) = _val
+#define PFLOW_CTRL_PDEV_VIDEO_STATS_GET(_pdev, _var) \
+	((_pdev)->vow.vistats[_var].value)
+#define PFLOW_CTRL_PDEV_VIDEO_STATS_ADD(_pdev, _var, _val) \
+	(((_pdev)->vow.vistats[_var]).value) += _val
+/*
+ * video delay stats
+ */
+#define PFLOW_CTRL_PDEV_DELAY_VIDEO_STATS_SET(_pdev, _var, _val) \
+	(((_pdev)->vow.delaystats[_var]).value) = _val
+#define PFLOW_CTRL_PDEV_DELAY_VIDEO_STATS_GET(_pdev, _var) \
+	((_pdev)->vow.delaystats[_var].value)
+#define PFLOW_CTRL_PDEV_DELAY_VIDEO_STATS_ADD(_pdev, _var, _val) \
+	(((_pdev)->vow.delaystats[_var]).value) += _val
 /*
  * Number of TLVs sent by FW. Needs to reflect
  * HTT_PPDU_STATS_MAX_TAG declared in FW
@@ -78,6 +103,47 @@ enum cdp_packet_type {
 	DOT11_MAX = 5,
 };
 
+/* TID level Tx/Rx stats
+ *
+ */
+enum cdp_txrx_tidq_stats {
+	/* Tx Counters */
+	TX_MSDU_TOTAL_LINUX_SUBSYSTEM,
+	TX_MSDU_TOTAL_FROM_OSIF,
+	TX_MSDU_TX_COMP_PKT_CNT,
+	/* Rx Counters */
+	RX_MSDU_TOTAL_FROM_FW,
+	RX_MSDU_MCAST_FROM_FW,
+	RX_TID_MISMATCH_FROM_FW,
+	RX_MSDU_MISC_PKTS,
+	RX_MSDU_IS_ARP,
+	RX_MSDU_IS_EAP,
+	RX_MSDU_IS_DHCP,
+	RX_AGGREGATE_10,
+	RX_AGGREGATE_20,
+	RX_AGGREGATE_30,
+	RX_AGGREGATE_40,
+	RX_AGGREGATE_50,
+	RX_AGGREGATE_60,
+	RX_AGGREGATE_MORE,
+	RX_AMSDU_1,
+	RX_AMSDU_2,
+	RX_AMSDU_3,
+	RX_AMSDU_4,
+	RX_AMSDU_MORE,
+	RX_MSDU_CHAINED_FROM_FW,
+	RX_MSDU_REORDER_FAILED_FROM_FW,
+	RX_MSDU_REORDER_FLUSHED_FROM_FW,
+	RX_MSDU_DISCARD_FROM_FW,
+	RX_MSDU_DUPLICATE_FROM_FW,
+	RX_MSDU_DELIVERED_TO_STACK,
+	TIDQ_STATS_MAX,
+};
+
+struct cdp_tidq_stats {
+	uint32_t stats[TIDQ_STATS_MAX];
+};
+
 /* struct cdp_pkt_info - packet info
  * @num: no of packets
  * @bytes: total no of bytes
@@ -1433,6 +1499,9 @@ enum _ol_ath_param_t {
 	OL_ATH_PARAM_CHAN_AP_TX_UTIL = 391,
 	OL_ATH_PARAM_CHAN_OBSS_RX_UTIL = 392,
 	OL_ATH_PARAM_CHAN_NON_WIFI = 393,
+#if PEER_FLOW_CONTROL
+	OL_ATH_PARAM_VIDEO_STATS_FC = 394,
+#endif
 };
 
 /* Enumeration of PDEV Configuration parameter */

+ 2 - 0
qdf/inc/qdf_nbuf.h

@@ -51,6 +51,8 @@
 #define QDF_NBUF_TRAC_EAPOL_ETH_TYPE		0x888E
 #define QDF_NBUF_TRAC_WAPI_ETH_TYPE		0x88b4
 #define QDF_NBUF_TRAC_ARP_ETH_TYPE		0x0806
+#define QDF_NBUF_PKT_IPV4_DSCP_MASK     0xFC
+#define QDF_NBUF_PKT_IPV4_DSCP_SHIFT  0x02
 #define QDF_NBUF_TRAC_TDLS_ETH_TYPE		0x890D
 #define QDF_NBUF_TRAC_IPV4_ETH_TYPE     0x0800
 #define QDF_NBUF_TRAC_IPV6_ETH_TYPE     0x86dd

+ 4 - 1
qdf/inc/qdf_net_types.h

@@ -51,7 +51,10 @@ typedef __in6_addr_t in6_addr_t;
 #define QDF_NET_ETH_LEN          QDF_NET_MAC_ADDR_MAX_LEN
 #define QDF_NET_MAX_MCAST_ADDR   64
 #define QDF_NET_IPV4_LEN         4
-
+#define QDF_TID_VI 5
+#define QDF_TID_VO 6
+#define QDF_TID_BE 0
+#define QDF_TID_BK 1
 /* Extended Traffic ID  passed to target if the TID is unknown */
 #define QDF_NBUF_TX_EXT_TID_INVALID    0x1f