diff --git a/dp/inc/cdp_txrx_cmn_struct.h b/dp/inc/cdp_txrx_cmn_struct.h
index 9cee5625cfb5..55af6e098329 100644
--- a/dp/inc/cdp_txrx_cmn_struct.h
+++ b/dp/inc/cdp_txrx_cmn_struct.h
@@ -2172,6 +2172,7 @@ 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
+ * @p2p_tcp_udp_checksumoffload: Enable/Disable TCP/UDP Checksum Offload for P2P
* @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
@@ -2188,6 +2189,7 @@ struct cdp_config_params {
unsigned int lro_enable:1;
unsigned int gro_enable:1;
unsigned int flow_steering_enable:1;
+ unsigned int p2p_tcp_udp_checksumoffload:1;
unsigned int nan_tcp_udp_checksumoffload:1;
unsigned int tcp_udp_checksumoffload:1;
unsigned int napi_enable:1;
@@ -2244,13 +2246,29 @@ struct cdp_monitor_filter {
};
/**
- * cdp_dp_cfg - dp ini config enum
+ * enum cdp_dp_cfg - CDP ENUMs to get to DP configation
+ * @cfg_dp_enable_data_stall: context passed to be used by consumer
+ * @cfg_dp_enable_p2p_ip_tcp_udp_checksum_offload: get P2P checksum config
+ * @cfg_dp_enable_nan_ip_tcp_udp_checksum_offload: get NAN TX checksum config
+ * @cfg_dp_enable_ip_tcp_udp_checksum_offload: get TX checksum config for others
+ * @cfg_dp_tso_enable: get TSO enable config
+ * @cfg_dp_lro_enable: get LRO enable config
+ * @cfg_dp_gro_enable: get GRP enable config
+ * @cfg_dp_tx_flow_start_queue_offset: get DP TX flow start queue offset
+ * @cfg_dp_tx_flow_stop_queue_threshold: get DP TX flow stop queue threshold
+ * @cfg_dp_ipa_uc_tx_buf_size: get IPA TX buf size config
+ * @cfg_dp_ipa_uc_tx_partition_base: get IPA UC TX partition base config
+ * @cfg_dp_ipa_uc_rx_ind_ring_count: get IPA rx indication ring count config
+ * @cfg_dp_enable_flow_steering: get flow steerint enable config
+ * @cfg_dp_reorder_offload_supported: get reorder offload support config
+ * @cfg_dp_ce_classify_enable: get CE classify enable config
+ * @cfg_dp_disable_intra_bss_fwd: get intra bss fwd config
+ * @cfg_dp_pktlog_buffer_size: get packet log buffer size config
*/
enum cdp_dp_cfg {
cfg_dp_enable_data_stall,
- /* checksum offload for NAN interface */
+ cfg_dp_enable_p2p_ip_tcp_udp_checksum_offload,
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,
diff --git a/dp/inc/cdp_txrx_mob_def.h b/dp/inc/cdp_txrx_mob_def.h
index 6a30c6428727..91f4be105148 100644
--- a/dp/inc/cdp_txrx_mob_def.h
+++ b/dp/inc/cdp_txrx_mob_def.h
@@ -287,6 +287,8 @@ struct txrx_pdev_cfg_param_t {
bool ip_tcp_udp_checksum_offload;
/* IP, TCP and UDP checksum offload for NAN Mode*/
bool nan_ip_tcp_udp_checksum_offload;
+ /* IP, TCP and UDP checksum offload for P2P Mode*/
+ bool p2p_ip_tcp_udp_checksum_offload;
/* Rx processing in thread from TXRX */
bool enable_rxthread;
/* CE classification enabled through INI */
diff --git a/dp/wifi3.0/dp_main.c b/dp/wifi3.0/dp_main.c
index 0b848894a4ed..282fe89056b6 100644
--- a/dp/wifi3.0/dp_main.c
+++ b/dp/wifi3.0/dp_main.c
@@ -9010,6 +9010,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->p2p_tcp_udp_checksumoffload =
+ params->p2p_tcp_udp_checksumoffload;
soc->wlan_cfg_ctx->nan_tcp_udp_checksumoffload =
params->nan_tcp_udp_checksumoffload;
soc->wlan_cfg_ctx->tcp_udp_checksumoffload =
@@ -9665,6 +9667,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_p2p_ip_tcp_udp_checksum_offload:
+ value = dpsoc->wlan_cfg_ctx->p2p_tcp_udp_checksumoffload;
+ break;
case cfg_dp_enable_nan_ip_tcp_udp_checksum_offload:
value = dpsoc->wlan_cfg_ctx->nan_tcp_udp_checksumoffload;
break;
diff --git a/dp/wifi3.0/dp_stats.c b/dp/wifi3.0/dp_stats.c
index 5acdfdcd35a7..3e9f76a554c0 100644
--- a/dp/wifi3.0/dp_stats.c
+++ b/dp/wifi3.0/dp_stats.c
@@ -4970,6 +4970,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("P2P Tcp Udp checksum offload: %u ",
+ soc_cfg_ctx->p2p_tcp_udp_checksumoffload);
DP_PRINT_STATS("NAN Tcp Udp checksum offload: %u ",
soc_cfg_ctx->nan_tcp_udp_checksumoffload);
DP_PRINT_STATS("Tcp Udp checksum offload: %u ",
diff --git a/dp/wifi3.0/dp_tx.c b/dp/wifi3.0/dp_tx.c
index e2d50da0258c..58ad9eb2440e 100644
--- a/dp/wifi3.0/dp_tx.c
+++ b/dp/wifi3.0/dp_tx.c
@@ -4048,6 +4048,10 @@ static void dp_tx_vdev_update_feature_flags(struct dp_vdev *vdev)
if (vdev->opmode == wlan_op_mode_ndi)
vdev->csum_enabled = wlan_cfg_get_nan_checksum_offload(cfg);
+ else if ((vdev->subtype == wlan_op_subtype_p2p_device) ||
+ (vdev->subtype == wlan_op_subtype_p2p_cli) ||
+ (vdev->subtype == wlan_op_subtype_p2p_go))
+ vdev->csum_enabled = wlan_cfg_get_p2p_checksum_offload(cfg);
else
vdev->csum_enabled = wlan_cfg_get_checksum_offload(cfg);
}
diff --git a/wlan_cfg/cfg_dp.h b/wlan_cfg/cfg_dp.h
index e0f6ec6b0239..f49b96ad078a 100644
--- a/wlan_cfg/cfg_dp.h
+++ b/wlan_cfg/cfg_dp.h
@@ -555,6 +555,26 @@
#define CFG_DP_NAPI \
CFG_INI_BOOL("dp_napi_enabled", PLATFORM_VALUE(true, false), \
"DP Napi Enabled")
+/*
+ *
+ * gEnableP2pIpTcpUdpChecksumOffload - Enable checksum offload for P2P mode
+ * @Min: 0
+ * @Max: 1
+ * @Default: 1
+ *
+ * This ini entry is used to enable/disable TX checksum(UDP/TCP) for P2P modes.
+ * This includes P2P device mode, P2P client mode and P2P GO mode.
+ * The feature is enabled by default. To disable TX checksum for P2P, add the
+ * following entry in ini file:
+ * gEnableP2pIpTcpUdpChecksumOffload=0
+ *
+ * Usage: External
+ *
+ *
+ */
+#define CFG_DP_P2P_TCP_UDP_CKSUM_OFFLOAD \
+ CFG_INI_BOOL("gEnableP2pIpTcpUdpChecksumOffload", true, \
+ "DP TCP UDP Checksum Offload for P2P mode (device/cli/go)")
/*
*
@@ -886,6 +906,7 @@
CFG(CFG_DP_NAPI) \
CFG(CFG_DP_TCP_UDP_CKSUM_OFFLOAD) \
CFG(CFG_DP_NAN_TCP_UDP_CKSUM_OFFLOAD) \
+ CFG(CFG_DP_P2P_TCP_UDP_CKSUM_OFFLOAD) \
CFG(CFG_DP_DEFRAG_TIMEOUT_CHECK) \
CFG(CFG_DP_WBM_RELEASE_RING) \
CFG(CFG_DP_TCL_CMD_CREDIT_RING) \
diff --git a/wlan_cfg/wlan_cfg.c b/wlan_cfg/wlan_cfg.c
index e94f09469ade..209e03a48710 100644
--- a/wlan_cfg/wlan_cfg.c
+++ b/wlan_cfg/wlan_cfg.c
@@ -541,6 +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);
+ wlan_cfg_ctx->p2p_tcp_udp_checksumoffload =
+ cfg_get(psoc, CFG_DP_P2P_TCP_UDP_CKSUM_OFFLOAD);
wlan_cfg_ctx->nan_tcp_udp_checksumoffload =
cfg_get(psoc, CFG_DP_NAN_TCP_UDP_CKSUM_OFFLOAD);
wlan_cfg_ctx->tcp_udp_checksumoffload =
@@ -1104,6 +1106,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_p2p_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg)
+{
+ return cfg->p2p_tcp_udp_checksumoffload;
+}
+
int wlan_cfg_get_nan_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg)
{
return cfg->nan_tcp_udp_checksumoffload;
diff --git a/wlan_cfg/wlan_cfg.h b/wlan_cfg/wlan_cfg.h
index 596cec193b56..eb3cb63ba480 100644
--- a/wlan_cfg/wlan_cfg.h
+++ b/wlan_cfg/wlan_cfg.h
@@ -140,8 +140,9 @@ struct wlan_srng_cfg {
* @rawmode_enabled: Flag indicating if RAW mode is enabled
* @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
+ * @p2p_tcp_udp_checksumoffload: enable/disable checksum offload for P2P mode
* @nan_tcp_udp_checksumoffload: enable/disable checksum offload for NAN mode
+ * @tcp_udp_checksumoffload: enable/disable checksum offload
* @nss_cfg: nss configuration
* @rx_defrag_min_timeout: rx defrag minimum timeout
* @wbm_release_ring: wbm release ring size
@@ -236,6 +237,7 @@ struct wlan_cfg_dp_soc_ctxt {
bool rawmode_enabled;
bool peer_flow_ctrl_enabled;
bool napi_enabled;
+ bool p2p_tcp_udp_checksumoffload;
bool nan_tcp_udp_checksumoffload;
bool tcp_udp_checksumoffload;
bool defrag_timeout_check;
@@ -1010,6 +1012,14 @@ int wlan_cfg_get_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg);
*/
int wlan_cfg_get_nan_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg);
+/*
+ * wlan_cfg_get_p2p_checksum_offload - Get checksum offload enable/disable val
+ * @wlan_cfg_soc_ctx
+ *
+ * Return: Checksum offload enable or disable value for P2P mode
+ */
+int wlan_cfg_get_p2p_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