qcacmn: refine the APIs for reap timer of monitor status ring
Since more than one components depend on reap timer of monitor status ring, add bitmap to record the trigger sources of the timer and refine the APIs/calling functions accordingly. With this change: When a new start request comes, if the source is CDP_MON_REAP_SOURCE_ANY, skip bit set, and start timer if any bit has been set in the bitmap; while for the other sources, set the bit and start timer if the bitmap is empty before that. When a new stop request comes, if the source is CDP_MON_REAP_SOURCE_ANY, skip bit clear, and stop timer if any bit has been set in the bitmap; while for the other sources, clear the bit and stop timer if the bitmap is empty after that. Change-Id: Idaa7837c4b93b247ff2236aa5072d309fa9548c2 CRs-Fixed: 3190347
这个提交包含在:
@@ -665,8 +665,10 @@ struct dp_mon_ops {
|
||||
bool (*mon_vdev_timer_stop)(struct dp_soc *soc);
|
||||
void (*mon_vdev_timer_deinit)(struct dp_soc *soc);
|
||||
void (*mon_reap_timer_init)(struct dp_soc *soc);
|
||||
void (*mon_reap_timer_start)(struct dp_soc *soc);
|
||||
bool (*mon_reap_timer_stop)(struct dp_soc *soc);
|
||||
bool (*mon_reap_timer_start)(struct dp_soc *soc,
|
||||
enum cdp_mon_reap_source source);
|
||||
bool (*mon_reap_timer_stop)(struct dp_soc *soc,
|
||||
enum cdp_mon_reap_source source);
|
||||
void (*mon_reap_timer_deinit)(struct dp_soc *soc);
|
||||
#ifdef QCA_MCOPY_SUPPORT
|
||||
QDF_STATUS (*mon_mcopy_check_deliver)(struct dp_pdev *pdev,
|
||||
@@ -806,6 +808,11 @@ struct dp_mon_soc {
|
||||
qdf_timer_t mon_reap_timer;
|
||||
uint8_t reap_timer_init;
|
||||
|
||||
qdf_spinlock_t reap_timer_lock;
|
||||
|
||||
/* Bitmap to record trigger sources of the reap timer */
|
||||
qdf_bitmap(mon_reap_src_bitmap, CDP_MON_REAP_SOURCE_NUM);
|
||||
|
||||
qdf_timer_t mon_vdev_timer;
|
||||
uint8_t mon_vdev_timer_state;
|
||||
|
||||
@@ -987,7 +994,6 @@ struct dp_mon_pdev {
|
||||
bool tx_sniffer_enable;
|
||||
/* mirror copy mode */
|
||||
enum m_copy_mode mcopy_mode;
|
||||
bool enable_reap_timer_non_pkt;
|
||||
bool bpr_enable;
|
||||
/* Pdev level flag to check peer based pktlog enabled or
|
||||
* disabled
|
||||
@@ -1291,21 +1297,6 @@ static inline bool dp_soc_is_full_mon_enable(struct dp_pdev *pdev)
|
||||
pdev->monitor_pdev->monitor_configured) ? true : false;
|
||||
}
|
||||
|
||||
/*
|
||||
* dp_mon_is_enable_reap_timer_non_pkt() - check if mon reap timer is
|
||||
* enabled by non-pkt log or not
|
||||
* @pdev: point to dp pdev
|
||||
*
|
||||
* Return: true if mon reap timer is enabled by non-pkt log
|
||||
*/
|
||||
static inline bool dp_mon_is_enable_reap_timer_non_pkt(struct dp_pdev *pdev)
|
||||
{
|
||||
if (qdf_unlikely(!pdev || !pdev->monitor_pdev))
|
||||
return false;
|
||||
|
||||
return pdev->monitor_pdev->enable_reap_timer_non_pkt;
|
||||
}
|
||||
|
||||
/*
|
||||
* dp_monitor_is_enable_mcopy_mode() - check if mcopy mode is enabled
|
||||
* @pdev: point to dp pdev
|
||||
@@ -3328,28 +3319,44 @@ void dp_monitor_reap_timer_deinit(struct dp_soc *soc)
|
||||
monitor_ops->mon_reap_timer_deinit(soc);
|
||||
}
|
||||
|
||||
static inline
|
||||
void dp_monitor_reap_timer_start(struct dp_soc *soc)
|
||||
/**
|
||||
* dp_monitor_reap_timer_start() - start reap timer of monitor status ring
|
||||
* @soc: point to soc
|
||||
* @source: trigger source
|
||||
*
|
||||
* Return: true if timer-start is performed, false otherwise.
|
||||
*/
|
||||
static inline bool
|
||||
dp_monitor_reap_timer_start(struct dp_soc *soc,
|
||||
enum cdp_mon_reap_source source)
|
||||
{
|
||||
struct dp_mon_ops *monitor_ops;
|
||||
struct dp_mon_soc *mon_soc = soc->monitor_soc;
|
||||
|
||||
if (!mon_soc) {
|
||||
dp_mon_debug("monitor soc is NULL");
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
monitor_ops = mon_soc->mon_ops;
|
||||
if (!monitor_ops || !monitor_ops->mon_reap_timer_start) {
|
||||
dp_mon_debug("callback not registered");
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
monitor_ops->mon_reap_timer_start(soc);
|
||||
return monitor_ops->mon_reap_timer_start(soc, source);
|
||||
}
|
||||
|
||||
static inline
|
||||
bool dp_monitor_reap_timer_stop(struct dp_soc *soc)
|
||||
/**
|
||||
* dp_monitor_reap_timer_stop() - stop reap timer of monitor status ring
|
||||
* @soc: point to soc
|
||||
* @source: trigger source
|
||||
*
|
||||
* Return: true if timer-stop is performed, false otherwise.
|
||||
*/
|
||||
static inline bool
|
||||
dp_monitor_reap_timer_stop(struct dp_soc *soc,
|
||||
enum cdp_mon_reap_source source)
|
||||
{
|
||||
struct dp_mon_ops *monitor_ops;
|
||||
struct dp_mon_soc *mon_soc = soc->monitor_soc;
|
||||
@@ -3365,7 +3372,7 @@ bool dp_monitor_reap_timer_stop(struct dp_soc *soc)
|
||||
return false;
|
||||
}
|
||||
|
||||
return monitor_ops->mon_reap_timer_stop(soc);
|
||||
return monitor_ops->mon_reap_timer_stop(soc, source);
|
||||
}
|
||||
|
||||
static inline
|
||||
@@ -3539,45 +3546,19 @@ static inline void dp_monitor_vdev_delete(struct dp_soc *soc,
|
||||
|
||||
#ifdef DP_POWER_SAVE
|
||||
/*
|
||||
* dp_monitor_pktlog_reap_pending_frames() - reap pending frames
|
||||
* dp_monitor_reap_timer_suspend() - Stop monitor reap timer
|
||||
* and reap any pending frames in ring
|
||||
* @pdev: point to dp pdev
|
||||
*
|
||||
* Return: void
|
||||
*/
|
||||
static inline void dp_monitor_pktlog_reap_pending_frames(struct dp_pdev *pdev)
|
||||
static inline void
|
||||
dp_monitor_reap_timer_suspend(struct dp_soc *soc)
|
||||
{
|
||||
struct dp_soc *soc;
|
||||
|
||||
if (qdf_unlikely(!pdev || !pdev->monitor_pdev))
|
||||
return;
|
||||
|
||||
soc = pdev->soc;
|
||||
|
||||
if (((pdev->monitor_pdev->rx_pktlog_mode != DP_RX_PKTLOG_DISABLED) ||
|
||||
dp_mon_is_enable_reap_timer_non_pkt(pdev))) {
|
||||
if (dp_monitor_reap_timer_stop(soc))
|
||||
dp_monitor_service_mon_rings(soc, DP_MON_REAP_BUDGET);
|
||||
}
|
||||
if (dp_monitor_reap_timer_stop(soc, CDP_MON_REAP_SOURCE_ANY))
|
||||
dp_monitor_service_mon_rings(soc, DP_MON_REAP_BUDGET);
|
||||
}
|
||||
|
||||
/*
|
||||
* dp_monitor_pktlog_start_reap_timer() - start reap timer
|
||||
* @pdev: point to dp pdev
|
||||
*
|
||||
* Return: void
|
||||
*/
|
||||
static inline void dp_monitor_pktlog_start_reap_timer(struct dp_pdev *pdev)
|
||||
{
|
||||
struct dp_soc *soc;
|
||||
|
||||
if (qdf_unlikely(!pdev || !pdev->monitor_pdev))
|
||||
return;
|
||||
|
||||
soc = pdev->soc;
|
||||
if (((pdev->monitor_pdev->rx_pktlog_mode != DP_RX_PKTLOG_DISABLED) ||
|
||||
dp_mon_is_enable_reap_timer_non_pkt(pdev)))
|
||||
dp_monitor_reap_timer_start(soc);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
@@ -3993,13 +3974,13 @@ QDF_STATUS dp_pdev_get_rx_mon_stats(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
|
||||
/*
|
||||
* dp_enable_mon_reap_timer() - enable/disable reap timer
|
||||
* @soc_hdl: Datapath soc handle
|
||||
* @pdev_id: id of objmgr pdev
|
||||
* @source: trigger source of the timer
|
||||
* @enable: Enable/Disable reap timer of monitor status ring
|
||||
*
|
||||
* Return: none
|
||||
* Return: true if a timer-start/stop is performed, false otherwise.
|
||||
*/
|
||||
void dp_enable_mon_reap_timer(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
|
||||
bool enable);
|
||||
bool dp_enable_mon_reap_timer(struct cdp_soc_t *soc_hdl,
|
||||
enum cdp_mon_reap_source source, bool enable);
|
||||
|
||||
/*
|
||||
* dp_monitor_lite_mon_disable_rx() - disables rx lite mon
|
||||
|
在新工单中引用
屏蔽一个用户