qcacmn: Propagate config parameters to datapath
Provide an API to accept the config parameters from the upper layer and store them in wlan_cfg_ctx. Enable/Disable the datapath features based on these parameters. Change-Id: I9336cac686bfb875cea242685a122ec98acdf8c2 CRs-Fixed: 2097229
This commit is contained in:

committed by
Gerrit - the friendly Code Review server

parent
bd20096931
commit
5a02b1f053
@@ -559,4 +559,24 @@ static inline int cdp_set_pn_check(ol_txrx_soc_handle soc,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* cdp_update_config_parameters(): function to propagate configuration
|
||||||
|
* parameters to datapath
|
||||||
|
* @soc: opaque soc handle
|
||||||
|
* @cfg: configuration handle
|
||||||
|
*
|
||||||
|
* Return: status: 0 - Success, non-zero: Failure
|
||||||
|
*/
|
||||||
|
static inline
|
||||||
|
QDF_STATUS cdp_update_config_parameters(ol_txrx_soc_handle soc,
|
||||||
|
struct cdp_config_params *cfg)
|
||||||
|
{
|
||||||
|
struct cdp_soc *psoc = (struct cdp_soc *)soc;
|
||||||
|
|
||||||
|
if (soc->ops->cmn_drv_ops->update_config_parameters)
|
||||||
|
return soc->ops->cmn_drv_ops->update_config_parameters(psoc,
|
||||||
|
cfg);
|
||||||
|
|
||||||
|
return QDF_STATUS_SUCCESS;
|
||||||
|
}
|
||||||
#endif /* _CDP_TXRX_CMN_H_ */
|
#endif /* _CDP_TXRX_CMN_H_ */
|
||||||
|
@@ -1166,4 +1166,26 @@ struct cdp_rx_indication_msdu {
|
|||||||
resvd1:19;
|
resvd1:19;
|
||||||
struct cdp_rate_stats extd;
|
struct cdp_rate_stats extd;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* struct cdp_config_params - Propagate configuration parameters to datapath
|
||||||
|
* @tso_enable: Enable/Disable TSO
|
||||||
|
* @lro_enable: Enable/Disable LRO
|
||||||
|
* @flow_steering_enable: Enable/Disable Rx Hash
|
||||||
|
* @tcp_Udp_ChecksumOffload: Enable/Disable tcp-Udp checksum Offload
|
||||||
|
* @napi_enable: Enable/Disable Napi
|
||||||
|
* @tx_flow_stop_queue_threshold: Value to Pause tx queues
|
||||||
|
* @tx_flow_start_queue_offset: Available Tx descriptors to unpause
|
||||||
|
* tx queue
|
||||||
|
*/
|
||||||
|
struct cdp_config_params {
|
||||||
|
unsigned int tso_enable:1;
|
||||||
|
unsigned int lro_enable:1;
|
||||||
|
unsigned int flow_steering_enable:1;
|
||||||
|
unsigned int tcp_udp_checksumoffload:1;
|
||||||
|
unsigned int napi_enable:1;
|
||||||
|
/* Set when QCA_LL_TX_FLOW_CONTROL_V2 is enabled */
|
||||||
|
uint8_t tx_flow_stop_queue_threshold;
|
||||||
|
uint8_t tx_flow_start_queue_offset;
|
||||||
|
};
|
||||||
#endif
|
#endif
|
||||||
|
@@ -213,6 +213,8 @@ struct cdp_cmn_ops {
|
|||||||
void (*set_pn_check)(struct cdp_vdev *vdev,
|
void (*set_pn_check)(struct cdp_vdev *vdev,
|
||||||
struct cdp_peer *peer_handle, enum cdp_sec_type sec_type,
|
struct cdp_peer *peer_handle, enum cdp_sec_type sec_type,
|
||||||
uint32_t *rx_pn);
|
uint32_t *rx_pn);
|
||||||
|
QDF_STATUS (*update_config_parameters)(struct cdp_soc *psoc,
|
||||||
|
struct cdp_config_params *params);
|
||||||
};
|
};
|
||||||
|
|
||||||
struct cdp_ctrl_ops {
|
struct cdp_ctrl_ops {
|
||||||
|
@@ -961,38 +961,6 @@ static QDF_STATUS dp_soc_interrupt_attach_poll(void *txrx_soc)
|
|||||||
|
|
||||||
return QDF_STATUS_SUCCESS;
|
return QDF_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_MCL
|
|
||||||
extern int con_mode_monitor;
|
|
||||||
static QDF_STATUS dp_soc_interrupt_attach(void *txrx_soc);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* dp_soc_interrupt_attach_wrapper() - Register handlers for DP interrupts
|
|
||||||
* @txrx_soc: DP SOC handle
|
|
||||||
*
|
|
||||||
* Call the appropriate attach function based on the mode of operation.
|
|
||||||
* This is a WAR for enabling monitor mode.
|
|
||||||
*
|
|
||||||
* Return: 0 for success. nonzero for failure.
|
|
||||||
*/
|
|
||||||
static QDF_STATUS dp_soc_interrupt_attach_wrapper(void *txrx_soc)
|
|
||||||
{
|
|
||||||
if (con_mode_monitor == QDF_GLOBAL_MONITOR_MODE) {
|
|
||||||
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
|
|
||||||
FL("Attach interrupts in Poll mode"));
|
|
||||||
return dp_soc_interrupt_attach_poll(txrx_soc);
|
|
||||||
} else {
|
|
||||||
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
|
|
||||||
FL("Attach interrupts in MSI mode"));
|
|
||||||
return dp_soc_interrupt_attach(txrx_soc);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
static QDF_STATUS dp_soc_interrupt_attach_wrapper(void *txrx_soc)
|
|
||||||
{
|
|
||||||
return dp_soc_interrupt_attach_poll(txrx_soc);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void dp_soc_interrupt_map_calculate_integrated(struct dp_soc *soc,
|
static void dp_soc_interrupt_map_calculate_integrated(struct dp_soc *soc,
|
||||||
@@ -1167,6 +1135,42 @@ static QDF_STATUS dp_soc_interrupt_attach(void *txrx_soc)
|
|||||||
return QDF_STATUS_SUCCESS;
|
return QDF_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef CONFIG_MCL
|
||||||
|
extern int con_mode_monitor;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* dp_soc_interrupt_attach_wrapper() - Register handlers for DP interrupts
|
||||||
|
* @txrx_soc: DP SOC handle
|
||||||
|
*
|
||||||
|
* Call the appropriate attach function based on the mode of operation.
|
||||||
|
* This is a WAR for enabling monitor mode.
|
||||||
|
*
|
||||||
|
* Return: 0 for success. nonzero for failure.
|
||||||
|
*/
|
||||||
|
static QDF_STATUS dp_soc_interrupt_attach_wrapper(void *txrx_soc)
|
||||||
|
{
|
||||||
|
struct dp_soc *soc = (struct dp_soc *)txrx_soc;
|
||||||
|
|
||||||
|
if (!(soc->wlan_cfg_ctx->napi_enabled) ||
|
||||||
|
con_mode_monitor == QDF_GLOBAL_MONITOR_MODE) {
|
||||||
|
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_DEBUG,
|
||||||
|
"%s: Poll mode", __func__);
|
||||||
|
return dp_soc_interrupt_attach_poll(txrx_soc);
|
||||||
|
} else {
|
||||||
|
|
||||||
|
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_DEBUG,
|
||||||
|
"%s: Interrupt mode", __func__);
|
||||||
|
return dp_soc_interrupt_attach(txrx_soc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
static QDF_STATUS dp_soc_interrupt_attach_wrapper(void *txrx_soc)
|
||||||
|
{
|
||||||
|
return dp_soc_interrupt_attach_poll(txrx_soc);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* dp_soc_interrupt_detach() - Deregister any allocations done for interrupts
|
* dp_soc_interrupt_detach() - Deregister any allocations done for interrupts
|
||||||
* @txrx_soc: DP SOC handle
|
* @txrx_soc: DP SOC handle
|
||||||
@@ -3741,6 +3745,7 @@ void dp_aggregate_vdev_stats(struct dp_vdev *vdev)
|
|||||||
if (soc->cdp_soc.ol_ops->update_dp_stats)
|
if (soc->cdp_soc.ol_ops->update_dp_stats)
|
||||||
soc->cdp_soc.ol_ops->update_dp_stats(vdev->pdev->osif_pdev,
|
soc->cdp_soc.ol_ops->update_dp_stats(vdev->pdev->osif_pdev,
|
||||||
&vdev->stats, vdev->vdev_id, UPDATE_VDEV_STATS);
|
&vdev->stats, vdev->vdev_id, UPDATE_VDEV_STATS);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -5029,6 +5034,17 @@ static void dp_txrx_path_stats(struct dp_soc *soc)
|
|||||||
pdev->stats.rx_ind_histogram.pkts_101_200);
|
pdev->stats.rx_ind_histogram.pkts_101_200);
|
||||||
DP_TRACE(FATAL, " 201+ Packets: %u",
|
DP_TRACE(FATAL, " 201+ Packets: %u",
|
||||||
pdev->stats.rx_ind_histogram.pkts_201_plus);
|
pdev->stats.rx_ind_histogram.pkts_201_plus);
|
||||||
|
|
||||||
|
DP_TRACE_STATS(ERROR, "%s: tso_enable: %u lro_enable: %u rx_hash: %u napi_enable: %u",
|
||||||
|
__func__,
|
||||||
|
pdev->soc->wlan_cfg_ctx->tso_enabled,
|
||||||
|
pdev->soc->wlan_cfg_ctx->lro_enabled,
|
||||||
|
pdev->soc->wlan_cfg_ctx->rx_hash,
|
||||||
|
pdev->soc->wlan_cfg_ctx->napi_enabled);
|
||||||
|
DP_TRACE_STATS(ERROR, "%s: Tx flow stop queue: %u tx flow start queue offset: %u",
|
||||||
|
__func__,
|
||||||
|
pdev->soc->wlan_cfg_ctx->tx_flow_stop_queue_threshold,
|
||||||
|
pdev->soc->wlan_cfg_ctx->tx_flow_start_queue_offset);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5082,6 +5098,64 @@ static QDF_STATUS dp_txrx_dump_stats(void *psoc, uint16_t value)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef QCA_LL_TX_FLOW_CONTROL_V2
|
||||||
|
/**
|
||||||
|
* dp_update_flow_control_parameters() - API to store datapath
|
||||||
|
* config parameters
|
||||||
|
* @soc: soc handle
|
||||||
|
* @cfg: ini parameter handle
|
||||||
|
*
|
||||||
|
* Return: void
|
||||||
|
*/
|
||||||
|
static inline
|
||||||
|
void dp_update_flow_control_parameters(struct dp_soc *soc,
|
||||||
|
struct cdp_config_params *params)
|
||||||
|
{
|
||||||
|
soc->wlan_cfg_ctx->tx_flow_stop_queue_threshold =
|
||||||
|
params->tx_flow_stop_queue_threshold;
|
||||||
|
soc->wlan_cfg_ctx->tx_flow_start_queue_offset =
|
||||||
|
params->tx_flow_start_queue_offset;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
static inline
|
||||||
|
void dp_update_flow_control_parameters(struct dp_soc *soc,
|
||||||
|
struct cdp_config_params *params)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* dp_update_config_parameters() - API to store datapath
|
||||||
|
* config parameters
|
||||||
|
* @soc: soc handle
|
||||||
|
* @cfg: ini parameter handle
|
||||||
|
*
|
||||||
|
* Return: status
|
||||||
|
*/
|
||||||
|
static
|
||||||
|
QDF_STATUS dp_update_config_parameters(struct cdp_soc *psoc,
|
||||||
|
struct cdp_config_params *params)
|
||||||
|
{
|
||||||
|
struct dp_soc *soc = (struct dp_soc *)psoc;
|
||||||
|
|
||||||
|
if (!(soc)) {
|
||||||
|
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
|
||||||
|
"%s: Invalid handle", __func__);
|
||||||
|
return QDF_STATUS_E_INVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
soc->wlan_cfg_ctx->tso_enabled = params->tso_enable;
|
||||||
|
soc->wlan_cfg_ctx->lro_enabled = params->lro_enable;
|
||||||
|
soc->wlan_cfg_ctx->rx_hash = params->flow_steering_enable;
|
||||||
|
soc->wlan_cfg_ctx->tcp_udp_checksumoffload =
|
||||||
|
params->tcp_udp_checksumoffload;
|
||||||
|
soc->wlan_cfg_ctx->napi_enabled = params->napi_enable;
|
||||||
|
|
||||||
|
dp_update_flow_control_parameters(soc, params);
|
||||||
|
|
||||||
|
return QDF_STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
static struct cdp_wds_ops dp_ops_wds = {
|
static struct cdp_wds_ops dp_ops_wds = {
|
||||||
.vdev_set_wds = dp_vdev_set_wds,
|
.vdev_set_wds = dp_vdev_set_wds,
|
||||||
};
|
};
|
||||||
@@ -5167,6 +5241,7 @@ static struct cdp_cmn_ops dp_ops_cmn = {
|
|||||||
#endif
|
#endif
|
||||||
.txrx_intr_detach = dp_soc_interrupt_detach,
|
.txrx_intr_detach = dp_soc_interrupt_detach,
|
||||||
.set_pn_check = dp_set_pn_check_wifi3,
|
.set_pn_check = dp_set_pn_check_wifi3,
|
||||||
|
.update_config_parameters = dp_update_config_parameters,
|
||||||
/* TODO: Add other functions */
|
/* TODO: Add other functions */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -181,11 +181,6 @@
|
|||||||
#define WLAN_CFG_HTT_PKT_TYPE 2
|
#define WLAN_CFG_HTT_PKT_TYPE 2
|
||||||
#define WLAN_CFG_MAX_PEER_ID 64
|
#define WLAN_CFG_MAX_PEER_ID 64
|
||||||
|
|
||||||
#ifdef WLAN_RX_HASH
|
|
||||||
#define WLAN_RX_HASH_ENABLE 1
|
|
||||||
#else
|
|
||||||
#define WLAN_RX_HASH_ENABLE 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef CONFIG_MCL
|
#ifdef CONFIG_MCL
|
||||||
static const int tx_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS] = {
|
static const int tx_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS] = {
|
||||||
@@ -329,9 +324,6 @@ struct wlan_cfg_dp_soc_ctxt *wlan_cfg_soc_attach()
|
|||||||
rxdma2host_ring_mask[i];
|
rxdma2host_ring_mask[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
wlan_cfg_ctx->rx_hash = WLAN_RX_HASH_ENABLE;
|
|
||||||
wlan_cfg_ctx->lro_enabled = WLAN_LRO_ENABLE;
|
|
||||||
|
|
||||||
/* This is default mapping and can be overridden by HW config
|
/* This is default mapping and can be overridden by HW config
|
||||||
* received from FW */
|
* received from FW */
|
||||||
wlan_cfg_set_hw_macid(wlan_cfg_ctx, 0, 1);
|
wlan_cfg_set_hw_macid(wlan_cfg_ctx, 0, 1);
|
||||||
@@ -675,12 +667,7 @@ int wlan_cfg_get_int_timer_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg)
|
|||||||
*/
|
*/
|
||||||
int wlan_cfg_get_tx_flow_stop_queue_th(struct wlan_cfg_dp_soc_ctxt *cfg)
|
int wlan_cfg_get_tx_flow_stop_queue_th(struct wlan_cfg_dp_soc_ctxt *cfg)
|
||||||
{
|
{
|
||||||
#ifdef QCA_WIFI_NAPIER_EMULATION
|
return cfg->tx_flow_stop_queue_threshold;
|
||||||
/* TODO remove this hack when INI hookup is ready */
|
|
||||||
return 15;
|
|
||||||
#else
|
|
||||||
return cfg->tx_flow_stop_queue_th;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -692,11 +679,6 @@ int wlan_cfg_get_tx_flow_stop_queue_th(struct wlan_cfg_dp_soc_ctxt *cfg)
|
|||||||
*/
|
*/
|
||||||
int wlan_cfg_get_tx_flow_start_queue_offset(struct wlan_cfg_dp_soc_ctxt *cfg)
|
int wlan_cfg_get_tx_flow_start_queue_offset(struct wlan_cfg_dp_soc_ctxt *cfg)
|
||||||
{
|
{
|
||||||
#ifdef QCA_WIFI_NAPIER_EMULATION
|
|
||||||
/* TODO remove this hack when INI hookup is ready */
|
|
||||||
return 10;
|
|
||||||
#else
|
|
||||||
return cfg->tx_flow_start_queue_offset;
|
return cfg->tx_flow_start_queue_offset;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
#endif /* QCA_LL_TX_FLOW_CONTROL_V2 */
|
#endif /* QCA_LL_TX_FLOW_CONTROL_V2 */
|
||||||
|
@@ -62,6 +62,7 @@
|
|||||||
#define DP_NON_QOS_TID 16
|
#define DP_NON_QOS_TID 16
|
||||||
|
|
||||||
struct wlan_cfg_dp_pdev_ctxt;
|
struct wlan_cfg_dp_pdev_ctxt;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* struct wlan_cfg_dp_soc_ctxt - Configuration parameters for SoC (core TxRx)
|
* struct wlan_cfg_dp_soc_ctxt - Configuration parameters for SoC (core TxRx)
|
||||||
* @num_int_ctxts - Number of NAPI/Interrupt contexts to be registered for DP
|
* @num_int_ctxts - Number of NAPI/Interrupt contexts to be registered for DP
|
||||||
@@ -90,8 +91,11 @@ struct wlan_cfg_dp_pdev_ctxt;
|
|||||||
* @int_reo_status_ring_mask - Bitmap of reo status ring interrupts mapped to each
|
* @int_reo_status_ring_mask - Bitmap of reo status ring interrupts mapped to each
|
||||||
* NAPI/Intr context
|
* NAPI/Intr context
|
||||||
* @int_ce_ring_mask - Bitmap of CE interrupts mapped to each NAPI/Intr context
|
* @int_ce_ring_mask - Bitmap of CE interrupts mapped to each NAPI/Intr context
|
||||||
* @lro_enabled - is LRO enabled
|
* @lro_enabled - enable/disable lro feature
|
||||||
* @rx_hash - Enable hash based steering of rx packets
|
* @rx_hash - Enable hash based steering of rx packets
|
||||||
|
* @tso_enabled - enable/disable tso feature
|
||||||
|
* @napi_enabled - enable/disable interrupt mode for reaping tx and rx packets
|
||||||
|
* @tcp_Udp_Checksumoffload - enable/disable checksum offload
|
||||||
* @nss_cfg - nss configuration
|
* @nss_cfg - nss configuration
|
||||||
*/
|
*/
|
||||||
struct wlan_cfg_dp_soc_ctxt {
|
struct wlan_cfg_dp_soc_ctxt {
|
||||||
@@ -128,10 +132,13 @@ struct wlan_cfg_dp_soc_ctxt {
|
|||||||
int base_hw_macid;
|
int base_hw_macid;
|
||||||
bool lro_enabled;
|
bool lro_enabled;
|
||||||
bool rx_hash;
|
bool rx_hash;
|
||||||
|
bool tso_enabled;
|
||||||
|
bool napi_enabled;
|
||||||
|
bool tcp_udp_checksumoffload;
|
||||||
int nss_cfg;
|
int nss_cfg;
|
||||||
#ifdef QCA_LL_TX_FLOW_CONTROL_V2
|
#ifdef QCA_LL_TX_FLOW_CONTROL_V2
|
||||||
int tx_flow_stop_queue_th;
|
uint32_t tx_flow_stop_queue_threshold;
|
||||||
int tx_flow_start_queue_offset;
|
uint32_t tx_flow_start_queue_offset;
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user