qcacmn: Add NAN TX checksum offload INI entry
Currently there is a single INI item tcp_udp_checksumoffload to enable or disable this feature for all the adapters. In some cases, we want to be able to enable this feature selectively for NAN mode. Add nan_tcp_udp_checksumoffload ini item to enable or disable checksum offload feature specifically for NAN mode. If nan_tcp_udp_checksumoffload is 'true' and tcp_udp_checksumoffload is false, hardware checksum offload will be enabled only for the NAN adapter and not for other adapters. CRs-Fixed: 2693638 Change-Id: I6e255ce68ddc7b01ebdefe4e5e8d2c985388fefe
This commit is contained in:
@@ -2172,7 +2172,8 @@ struct cdp_rx_indication_msdu {
|
||||
* @lro_enable: Enable/Disable LRO
|
||||
* @gro_enable: Enable/Disable GRO
|
||||
* @flow_steering_enable: Enable/Disable Rx Hash based flow steering
|
||||
* @tcp_Udp_ChecksumOffload: Enable/Disable tcp-Udp checksum Offload
|
||||
* @nan_tcp_udp_checksumoffload: Enable/Disable TCP/UDP Checksum Offload for NAN
|
||||
* @tcp_udp_checksumoffload: Enable/Disable TCP/UDP Checksum Offload
|
||||
* @napi_enable: Enable/Disable Napi
|
||||
* @ipa_enable: Flag indicating if IPA is enabled or not
|
||||
* @tx_flow_stop_queue_threshold: Value to Pause tx queues
|
||||
@@ -2187,6 +2188,7 @@ struct cdp_config_params {
|
||||
unsigned int lro_enable:1;
|
||||
unsigned int gro_enable:1;
|
||||
unsigned int flow_steering_enable:1;
|
||||
unsigned int nan_tcp_udp_checksumoffload:1;
|
||||
unsigned int tcp_udp_checksumoffload:1;
|
||||
unsigned int napi_enable:1;
|
||||
unsigned int ipa_enable:1;
|
||||
@@ -2246,6 +2248,9 @@ struct cdp_monitor_filter {
|
||||
*/
|
||||
enum cdp_dp_cfg {
|
||||
cfg_dp_enable_data_stall,
|
||||
/* checksum offload for NAN interface */
|
||||
cfg_dp_enable_nan_ip_tcp_udp_checksum_offload,
|
||||
/* generic checksum offload for other interfaces */
|
||||
cfg_dp_enable_ip_tcp_udp_checksum_offload,
|
||||
cfg_dp_tso_enable,
|
||||
cfg_dp_lro_enable,
|
||||
|
@@ -285,6 +285,8 @@ struct txrx_pdev_cfg_param_t {
|
||||
uint32_t uc_tx_partition_base;
|
||||
/* IP, TCP and UDP checksum offload */
|
||||
bool ip_tcp_udp_checksum_offload;
|
||||
/* IP, TCP and UDP checksum offload for NAN Mode*/
|
||||
bool nan_ip_tcp_udp_checksum_offload;
|
||||
/* Rx processing in thread from TXRX */
|
||||
bool enable_rxthread;
|
||||
/* CE classification enabled through INI */
|
||||
|
@@ -8807,6 +8807,8 @@ QDF_STATUS dp_update_config_parameters(struct cdp_soc *psoc,
|
||||
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->nan_tcp_udp_checksumoffload =
|
||||
params->nan_tcp_udp_checksumoffload;
|
||||
soc->wlan_cfg_ctx->tcp_udp_checksumoffload =
|
||||
params->tcp_udp_checksumoffload;
|
||||
soc->wlan_cfg_ctx->napi_enabled = params->napi_enable;
|
||||
@@ -9460,6 +9462,9 @@ static uint32_t dp_get_cfg(struct cdp_soc_t *soc, enum cdp_dp_cfg cfg)
|
||||
case cfg_dp_enable_data_stall:
|
||||
value = dpsoc->wlan_cfg_ctx->enable_data_stall_detection;
|
||||
break;
|
||||
case cfg_dp_enable_nan_ip_tcp_udp_checksum_offload:
|
||||
value = dpsoc->wlan_cfg_ctx->nan_tcp_udp_checksumoffload;
|
||||
break;
|
||||
case cfg_dp_enable_ip_tcp_udp_checksum_offload:
|
||||
value = dpsoc->wlan_cfg_ctx->tcp_udp_checksumoffload;
|
||||
break;
|
||||
|
@@ -4946,6 +4946,8 @@ void dp_print_soc_cfg_params(struct dp_soc *soc)
|
||||
soc_cfg_ctx->peer_flow_ctrl_enabled);
|
||||
DP_PRINT_STATS("napi enabled: %u ",
|
||||
soc_cfg_ctx->napi_enabled);
|
||||
DP_PRINT_STATS("NAN Tcp Udp checksum offload: %u ",
|
||||
soc_cfg_ctx->nan_tcp_udp_checksumoffload);
|
||||
DP_PRINT_STATS("Tcp Udp checksum offload: %u ",
|
||||
soc_cfg_ctx->tcp_udp_checksumoffload);
|
||||
DP_PRINT_STATS("Defrag timeout check: %u ",
|
||||
|
@@ -1212,7 +1212,7 @@ static QDF_STATUS dp_tx_hw_enqueue(struct dp_soc *soc, struct dp_vdev *vdev,
|
||||
hal_tx_desc_set_to_fw(hal_tx_desc_cached, 1);
|
||||
|
||||
/* verify checksum offload configuration*/
|
||||
if ((wlan_cfg_get_checksum_offload(soc->wlan_cfg_ctx)) &&
|
||||
if (vdev->csum_enabled &&
|
||||
((qdf_nbuf_get_tx_cksum(tx_desc->nbuf) == QDF_NBUF_TX_CKSUM_TCP_UDP)
|
||||
|| qdf_nbuf_is_tso(tx_desc->nbuf))) {
|
||||
hal_tx_desc_set_l3_checksum_en(hal_tx_desc_cached, 1);
|
||||
@@ -4015,6 +4015,26 @@ qdf_nbuf_t dp_tx_non_std(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
|
||||
}
|
||||
#endif
|
||||
|
||||
static void dp_tx_vdev_update_feature_flags(struct dp_vdev *vdev)
|
||||
{
|
||||
struct wlan_cfg_dp_soc_ctxt *cfg;
|
||||
|
||||
struct dp_soc *soc;
|
||||
|
||||
soc = vdev->pdev->soc;
|
||||
if (!soc)
|
||||
return;
|
||||
|
||||
cfg = soc->wlan_cfg_ctx;
|
||||
if (!cfg)
|
||||
return;
|
||||
|
||||
if (vdev->opmode == wlan_op_mode_ndi)
|
||||
vdev->csum_enabled = wlan_cfg_get_nan_checksum_offload(cfg);
|
||||
else
|
||||
vdev->csum_enabled = wlan_cfg_get_checksum_offload(cfg);
|
||||
}
|
||||
|
||||
/**
|
||||
* dp_tx_vdev_attach() - attach vdev to dp tx
|
||||
* @vdev: virtual device instance
|
||||
@@ -4046,6 +4066,8 @@ QDF_STATUS dp_tx_vdev_attach(struct dp_vdev *vdev)
|
||||
|
||||
dp_tx_vdev_update_search_flags(vdev);
|
||||
|
||||
dp_tx_vdev_update_feature_flags(vdev);
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
@@ -1940,6 +1940,9 @@ struct dp_vdev {
|
||||
/* Multicast enhancement enabled */
|
||||
uint8_t mcast_enhancement_en;
|
||||
|
||||
/* HW TX Checksum Enabled Flag */
|
||||
uint8_t csum_enabled;
|
||||
|
||||
/* vdev_id - ID used to specify a particular vdev to the target */
|
||||
uint8_t vdev_id;
|
||||
|
||||
|
@@ -552,6 +552,32 @@
|
||||
CFG_INI_BOOL("dp_napi_enabled", PLATFORM_VALUE(true, false), \
|
||||
"DP Napi Enabled")
|
||||
|
||||
/*
|
||||
* <ini>
|
||||
* gEnableNanIpTcpUdpChecksumOffload - Enable checksum offload for NAN mode
|
||||
* @Min: 0
|
||||
* @Max: 1
|
||||
* @Default: 1
|
||||
*
|
||||
* Usage: External
|
||||
*
|
||||
* </ini>
|
||||
*/
|
||||
#define CFG_DP_NAN_TCP_UDP_CKSUM_OFFLOAD \
|
||||
CFG_INI_BOOL("gEnableNanIpTcpUdpChecksumOffload", true, \
|
||||
"DP TCP UDP Checksum Offload for NAN mode")
|
||||
|
||||
/*
|
||||
* <ini>
|
||||
* gEnableIpTcpUdpChecksumOffload - Enable checksum offload
|
||||
* @Min: 0
|
||||
* @Max: 1
|
||||
* @Default: 1
|
||||
*
|
||||
* Usage: External
|
||||
*
|
||||
* </ini>
|
||||
*/
|
||||
#define CFG_DP_TCP_UDP_CKSUM_OFFLOAD \
|
||||
CFG_INI_BOOL("gEnableIpTcpUdpChecksumOffload", true, \
|
||||
"DP TCP UDP Checksum Offload")
|
||||
@@ -844,6 +870,7 @@
|
||||
CFG(CFG_DP_PEER_FLOW_CTRL) \
|
||||
CFG(CFG_DP_NAPI) \
|
||||
CFG(CFG_DP_TCP_UDP_CKSUM_OFFLOAD) \
|
||||
CFG(CFG_DP_NAN_TCP_UDP_CKSUM_OFFLOAD) \
|
||||
CFG(CFG_DP_DEFRAG_TIMEOUT_CHECK) \
|
||||
CFG(CFG_DP_WBM_RELEASE_RING) \
|
||||
CFG(CFG_DP_TCL_CMD_CREDIT_RING) \
|
||||
|
@@ -541,7 +541,8 @@ wlan_cfg_soc_attach(struct cdp_ctrl_objmgr_psoc *psoc)
|
||||
wlan_cfg_ctx->peer_flow_ctrl_enabled =
|
||||
cfg_get(psoc, CFG_DP_PEER_FLOW_CTRL);
|
||||
wlan_cfg_ctx->napi_enabled = cfg_get(psoc, CFG_DP_NAPI);
|
||||
/*Enable checksum offload by default*/
|
||||
wlan_cfg_ctx->nan_tcp_udp_checksumoffload =
|
||||
cfg_get(psoc, CFG_DP_NAN_TCP_UDP_CKSUM_OFFLOAD);
|
||||
wlan_cfg_ctx->tcp_udp_checksumoffload =
|
||||
cfg_get(psoc, CFG_DP_TCP_UDP_CKSUM_OFFLOAD);
|
||||
wlan_cfg_ctx->per_pkt_trace = cfg_get(psoc, CFG_DP_PER_PKT_LOGGING);
|
||||
@@ -1101,6 +1102,11 @@ int wlan_cfg_get_int_timer_threshold_mon(struct wlan_cfg_dp_soc_ctxt *cfg)
|
||||
return cfg->int_timer_threshold_mon;
|
||||
}
|
||||
|
||||
int wlan_cfg_get_nan_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg)
|
||||
{
|
||||
return cfg->nan_tcp_udp_checksumoffload;
|
||||
}
|
||||
|
||||
int wlan_cfg_get_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg)
|
||||
{
|
||||
return cfg->tcp_udp_checksumoffload;
|
||||
|
@@ -141,6 +141,7 @@ struct wlan_srng_cfg {
|
||||
* @peer_flow_ctrl_enabled: Flag indicating if peer flow control is enabled
|
||||
* @napi_enabled: enable/disable interrupt mode for reaping tx and rx packets
|
||||
* @tcp_udp_checksumoffload: enable/disable checksum offload
|
||||
* @nan_tcp_udp_checksumoffload: enable/disable checksum offload for NAN mode
|
||||
* @nss_cfg: nss configuration
|
||||
* @rx_defrag_min_timeout: rx defrag minimum timeout
|
||||
* @wbm_release_ring: wbm release ring size
|
||||
@@ -234,6 +235,7 @@ struct wlan_cfg_dp_soc_ctxt {
|
||||
bool rawmode_enabled;
|
||||
bool peer_flow_ctrl_enabled;
|
||||
bool napi_enabled;
|
||||
bool nan_tcp_udp_checksumoffload;
|
||||
bool tcp_udp_checksumoffload;
|
||||
bool defrag_timeout_check;
|
||||
int nss_cfg;
|
||||
@@ -997,6 +999,14 @@ int wlan_cfg_get_int_timer_threshold_mon(struct wlan_cfg_dp_soc_ctxt *cfg);
|
||||
*/
|
||||
int wlan_cfg_get_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg);
|
||||
|
||||
/*
|
||||
* wlan_cfg_get_nan_checksum_offload - Get checksum offload enable/disable val
|
||||
* @wlan_cfg_soc_ctx
|
||||
*
|
||||
* Return: Checksum offload enable or disable value for NAN mode
|
||||
*/
|
||||
int wlan_cfg_get_nan_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg);
|
||||
|
||||
/*
|
||||
* wlan_cfg_tx_ring_size - Get Tx DMA ring size (TCL Data Ring)
|
||||
* @wlan_cfg_soc_ctx
|
||||
|
Reference in New Issue
Block a user