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:
Mohit Khanna
2020-05-21 16:54:56 -07:00
committed by nshrivas
parent d0b3820279
commit 97200aab9c
9 changed files with 86 additions and 4 deletions

View File

@@ -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) \

View File

@@ -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;

View File

@@ -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