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: Icbdc835a51a6fea87c06174e9fc63d5d007aec1d
CRs-Fixed: 2097229
这个提交包含在:
Venkata Sharath Chandra Manchala
2017-07-10 11:59:54 -07:00
提交者 snandini
父节点 cfbb8952ff
当前提交 3e8add86bb
修改 6 个文件,包含 139 行新增30 行删除

查看文件

@@ -100,7 +100,7 @@ static inline struct cdp_pdev *cdp_pdev_attach
{
if (soc->ops->cmn_drv_ops->txrx_pdev_attach)
return soc->ops->cmn_drv_ops->txrx_pdev_attach(soc, ctrl_pdev,
htc_pdev, osdev, pdev_id);
htc_pdev, osdev, pdev_id);
return NULL;
}
@@ -559,4 +559,24 @@ static inline int cdp_set_pn_check(ol_txrx_soc_handle soc,
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_ */

查看文件

@@ -1282,4 +1282,26 @@ struct cdp_rx_indication_msdu {
resvd1:19;
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

查看文件

@@ -213,6 +213,8 @@ struct cdp_cmn_ops {
void (*set_pn_check)(struct cdp_vdev *vdev,
struct cdp_peer *peer_handle, enum cdp_sec_type sec_type,
uint32_t *rx_pn);
QDF_STATUS (*update_config_parameters)(struct cdp_soc *psoc,
struct cdp_config_params *params);
};
struct cdp_ctrl_ops {

查看文件

@@ -965,10 +965,9 @@ static QDF_STATUS dp_soc_interrupt_attach_poll(void *txrx_soc)
return QDF_STATUS_SUCCESS;
}
#ifdef CONFIG_MCL
#if defined(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
@@ -980,13 +979,17 @@ static QDF_STATUS dp_soc_interrupt_attach(void *txrx_soc);
*/
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"));
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_ERROR,
FL("Attach interrupts in MSI mode"));
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_DEBUG,
"%s: Interrupt mode", __func__);
return dp_soc_interrupt_attach(txrx_soc);
}
}
@@ -3899,6 +3902,7 @@ void dp_aggregate_vdev_stats(struct dp_vdev *vdev)
if (soc->cdp_soc.ol_ops->update_dp_stats)
soc->cdp_soc.ol_ops->update_dp_stats(vdev->pdev->osif_pdev,
&vdev->stats, vdev->vdev_id, UPDATE_VDEV_STATS);
}
/**
@@ -5244,6 +5248,19 @@ static void dp_txrx_path_stats(struct dp_soc *soc)
pdev->stats.rx_ind_histogram.pkts_101_200);
DP_TRACE(FATAL, " 201+ Packets: %u",
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);
#ifdef QCA_LL_TX_FLOW_CONTROL_V2
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);
#endif
}
}
@@ -5297,6 +5314,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 = {
.vdev_set_wds = dp_vdev_set_wds,
};
@@ -5399,6 +5474,7 @@ static struct cdp_cmn_ops dp_ops_cmn = {
#endif
.txrx_intr_detach = dp_soc_interrupt_detach,
.set_pn_check = dp_set_pn_check_wifi3,
.update_config_parameters = dp_update_config_parameters,
/* TODO: Add other functions */
.txrx_data_tx_cb_set = dp_txrx_data_tx_cb_set
};

查看文件

@@ -181,11 +181,6 @@
#define WLAN_CFG_HTT_PKT_TYPE 2
#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
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];
}
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
* received from FW */
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)
{
#ifdef QCA_WIFI_NAPIER_EMULATION
/* TODO remove this hack when INI hookup is ready */
return 15;
#else
return cfg->tx_flow_stop_queue_th;
#endif
return cfg->tx_flow_stop_queue_threshold;
}
/**
@@ -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)
{
#ifdef QCA_WIFI_NAPIER_EMULATION
/* TODO remove this hack when INI hookup is ready */
return 10;
#else
return cfg->tx_flow_start_queue_offset;
#endif
}
#endif /* QCA_LL_TX_FLOW_CONTROL_V2 */

查看文件

@@ -62,6 +62,7 @@
#define DP_NON_QOS_TID 16
struct wlan_cfg_dp_pdev_ctxt;
/**
* 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
@@ -90,8 +91,11 @@ struct wlan_cfg_dp_pdev_ctxt;
* @int_reo_status_ring_mask - Bitmap of reo status ring 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
* @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
*/
struct wlan_cfg_dp_soc_ctxt {
@@ -128,10 +132,13 @@ struct wlan_cfg_dp_soc_ctxt {
int base_hw_macid;
bool lro_enabled;
bool rx_hash;
bool tso_enabled;
bool napi_enabled;
bool tcp_udp_checksumoffload;
int nss_cfg;
#ifdef QCA_LL_TX_FLOW_CONTROL_V2
int tx_flow_stop_queue_th;
int tx_flow_start_queue_offset;
uint32_t tx_flow_stop_queue_threshold;
uint32_t tx_flow_start_queue_offset;
#endif
};