qcacmn: dp: Add support to update tsf timestamp in data packet
Add support to update tsf timestamp on driver entry and exit in data packet. This helps debug latency issue in XR usecases Change-Id: I9c966c1b8cb09dc5eab6104fdad36c19a1d68045 CRs-Fixed: 3090108
This commit is contained in:

committed by
Madan Koyyalamudi

parent
3e4c2182ff
commit
33528eaa41
@@ -996,6 +996,12 @@ typedef void (*ol_txrx_pktdump_cb)(ol_txrx_soc_handle soc,
|
|||||||
uint8_t status,
|
uint8_t status,
|
||||||
uint8_t type);
|
uint8_t type);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ol_txrx_get_tsf_time - callback to get tsf time
|
||||||
|
*/
|
||||||
|
typedef QDF_STATUS(*ol_txrx_get_tsf_time)(void *osif_dev, uint64_t input_time,
|
||||||
|
uint64_t *tsf_time);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ol_txrx_ops - (pointers to) the functions used for tx and rx
|
* ol_txrx_ops - (pointers to) the functions used for tx and rx
|
||||||
* data xfer
|
* data xfer
|
||||||
@@ -1083,6 +1089,7 @@ struct ol_txrx_ops {
|
|||||||
ol_txrx_mcast_me_fp me_convert;
|
ol_txrx_mcast_me_fp me_convert;
|
||||||
|
|
||||||
ol_txrx_get_key_fp get_key;
|
ol_txrx_get_key_fp get_key;
|
||||||
|
ol_txrx_get_tsf_time get_tsf_time;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -6484,6 +6484,7 @@ static QDF_STATUS dp_vdev_register_wifi3(struct cdp_soc_t *soc_hdl,
|
|||||||
vdev->osif_proxy_arp = txrx_ops->proxy_arp;
|
vdev->osif_proxy_arp = txrx_ops->proxy_arp;
|
||||||
#endif
|
#endif
|
||||||
vdev->me_convert = txrx_ops->me_convert;
|
vdev->me_convert = txrx_ops->me_convert;
|
||||||
|
vdev->get_tsf_time = txrx_ops->get_tsf_time;
|
||||||
|
|
||||||
dp_vdev_register_rx_eapol(vdev, txrx_ops);
|
dp_vdev_register_rx_eapol(vdev, txrx_ops);
|
||||||
|
|
||||||
|
@@ -2990,6 +2990,8 @@ struct dp_vdev {
|
|||||||
/* completion function used by this vdev*/
|
/* completion function used by this vdev*/
|
||||||
ol_txrx_completion_fp tx_comp;
|
ol_txrx_completion_fp tx_comp;
|
||||||
|
|
||||||
|
ol_txrx_get_tsf_time get_tsf_time;
|
||||||
|
|
||||||
/* deferred vdev deletion state */
|
/* deferred vdev deletion state */
|
||||||
struct {
|
struct {
|
||||||
/* VDEV delete pending */
|
/* VDEV delete pending */
|
||||||
|
@@ -574,3 +574,25 @@ void dp_tx_comp_get_prefetched_params_from_hal_desc(
|
|||||||
qdf_prefetch((uint8_t *)*r_tx_desc);
|
qdf_prefetch((uint8_t *)*r_tx_desc);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONFIG_DP_PKT_ADD_TIMESTAMP
|
||||||
|
void dp_pkt_add_timestamp(struct dp_vdev *vdev,
|
||||||
|
enum qdf_pkt_timestamp_index index, uint64_t time,
|
||||||
|
qdf_nbuf_t nbuf)
|
||||||
|
{
|
||||||
|
if (qdf_unlikely(qdf_is_dp_pkt_timestamp_enabled())) {
|
||||||
|
uint64_t tsf_time;
|
||||||
|
|
||||||
|
if (vdev->get_tsf_time) {
|
||||||
|
vdev->get_tsf_time(vdev->osif_vdev, time, &tsf_time);
|
||||||
|
qdf_add_dp_pkt_timestamp(nbuf, index, tsf_time);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void dp_pkt_get_timestamp(uint64_t *time)
|
||||||
|
{
|
||||||
|
if (qdf_unlikely(qdf_is_dp_pkt_timestamp_enabled()))
|
||||||
|
*time = qdf_get_log_timestamp();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
@@ -23,6 +23,7 @@
|
|||||||
#include <dp_mon.h>
|
#include <dp_mon.h>
|
||||||
#include <hal_li_tx.h>
|
#include <hal_li_tx.h>
|
||||||
#include <hal_li_rx.h>
|
#include <hal_li_rx.h>
|
||||||
|
#include <qdf_pkt_add_timestamp.h>
|
||||||
|
|
||||||
/* WBM2SW ring id for rx release */
|
/* WBM2SW ring id for rx release */
|
||||||
#define WBM2SW_REL_ERR_RING_NUM 3
|
#define WBM2SW_REL_ERR_RING_NUM 3
|
||||||
@@ -108,4 +109,39 @@ qdf_size_t dp_get_context_size_li(enum dp_context_type context_type);
|
|||||||
|
|
||||||
qdf_size_t dp_mon_get_context_size_li(enum dp_context_type context_type);
|
qdf_size_t dp_mon_get_context_size_li(enum dp_context_type context_type);
|
||||||
|
|
||||||
|
#ifdef CONFIG_DP_PKT_ADD_TIMESTAMP
|
||||||
|
/**
|
||||||
|
* dp_pkt_add_timestamp() - add timestamp in data payload
|
||||||
|
*
|
||||||
|
* @vdev: dp vdev
|
||||||
|
* @index: index to decide offset in payload
|
||||||
|
* @time: timestamp to add in data payload
|
||||||
|
* @nbuf: network buffer
|
||||||
|
*
|
||||||
|
* Return: none
|
||||||
|
*/
|
||||||
|
void dp_pkt_add_timestamp(struct dp_vdev *vdev,
|
||||||
|
enum qdf_pkt_timestamp_index index, uint64_t time,
|
||||||
|
qdf_nbuf_t nbuf);
|
||||||
|
/**
|
||||||
|
* dp_pkt_get_timestamp() - get current system time
|
||||||
|
*
|
||||||
|
* @time: return current system time
|
||||||
|
*
|
||||||
|
* Return: none
|
||||||
|
*/
|
||||||
|
void dp_pkt_get_timestamp(uint64_t *time);
|
||||||
|
#else
|
||||||
|
static inline
|
||||||
|
void dp_pkt_add_timestamp(struct dp_vdev *vdev,
|
||||||
|
enum qdf_pkt_timestamp_index index, uint64_t time,
|
||||||
|
qdf_nbuf_t nbuf)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline
|
||||||
|
void dp_pkt_get_timestamp(uint64_t *time)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
@@ -41,6 +41,7 @@
|
|||||||
#endif
|
#endif
|
||||||
#include "dp_hist.h"
|
#include "dp_hist.h"
|
||||||
#include "dp_rx_buffer_pool.h"
|
#include "dp_rx_buffer_pool.h"
|
||||||
|
#include "dp_li.h"
|
||||||
|
|
||||||
static inline
|
static inline
|
||||||
bool is_sa_da_idx_valid(uint32_t max_ast,
|
bool is_sa_da_idx_valid(uint32_t max_ast,
|
||||||
@@ -252,6 +253,7 @@ uint32_t dp_rx_process_li(struct dp_intr *int_ctx,
|
|||||||
uint32_t peer_ext_stats;
|
uint32_t peer_ext_stats;
|
||||||
uint32_t dsf;
|
uint32_t dsf;
|
||||||
uint32_t max_ast;
|
uint32_t max_ast;
|
||||||
|
uint64_t current_time = 0;
|
||||||
|
|
||||||
DP_HIST_INIT();
|
DP_HIST_INIT();
|
||||||
|
|
||||||
@@ -289,6 +291,8 @@ more_data:
|
|||||||
rx_pdev = NULL;
|
rx_pdev = NULL;
|
||||||
tid_stats = NULL;
|
tid_stats = NULL;
|
||||||
|
|
||||||
|
dp_pkt_get_timestamp(¤t_time);
|
||||||
|
|
||||||
if (qdf_unlikely(dp_rx_srng_access_start(int_ctx, soc, hal_ring_hdl))) {
|
if (qdf_unlikely(dp_rx_srng_access_start(int_ctx, soc, hal_ring_hdl))) {
|
||||||
/*
|
/*
|
||||||
* Need API to convert from hal_ring pointer to
|
* Need API to convert from hal_ring pointer to
|
||||||
@@ -882,6 +886,10 @@ done:
|
|||||||
dp_rx_fill_gro_info(soc, rx_tlv_hdr, nbuf, &rx_ol_pkt_cnt);
|
dp_rx_fill_gro_info(soc, rx_tlv_hdr, nbuf, &rx_ol_pkt_cnt);
|
||||||
|
|
||||||
dp_rx_update_stats(soc, nbuf);
|
dp_rx_update_stats(soc, nbuf);
|
||||||
|
|
||||||
|
dp_pkt_add_timestamp(peer->vdev, QDF_PKT_RX_DRIVER_ENTRY,
|
||||||
|
current_time, nbuf);
|
||||||
|
|
||||||
DP_RX_LIST_APPEND(deliver_list_head,
|
DP_RX_LIST_APPEND(deliver_list_head,
|
||||||
deliver_list_tail,
|
deliver_list_tail,
|
||||||
nbuf);
|
nbuf);
|
||||||
|
@@ -29,6 +29,7 @@
|
|||||||
#ifdef FEATURE_WDS
|
#ifdef FEATURE_WDS
|
||||||
#include "dp_txrx_wds.h"
|
#include "dp_txrx_wds.h"
|
||||||
#endif
|
#endif
|
||||||
|
#include "dp_li.h"
|
||||||
|
|
||||||
extern uint8_t sec_type_map[MAX_CDP_SEC_TYPE];
|
extern uint8_t sec_type_map[MAX_CDP_SEC_TYPE];
|
||||||
|
|
||||||
@@ -452,6 +453,8 @@ dp_tx_hw_enqueue_li(struct dp_soc *soc, struct dp_vdev *vdev,
|
|||||||
|
|
||||||
ring_access_fail:
|
ring_access_fail:
|
||||||
dp_tx_ring_access_end_wrapper(soc, hal_ring_hdl, coalesce);
|
dp_tx_ring_access_end_wrapper(soc, hal_ring_hdl, coalesce);
|
||||||
|
dp_pkt_add_timestamp(vdev, QDF_PKT_TX_DRIVER_EXIT,
|
||||||
|
qdf_get_log_timestamp(), tx_desc->nbuf);
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user