From 8d0c219dde7177fee49742a0938d83fd03bdb53e Mon Sep 17 00:00:00 2001 From: chenguo Date: Fri, 1 Dec 2017 19:35:53 +0800 Subject: [PATCH] qcacmn: Hook checksum offload INI key to DP TX path Enable or disable TCP\UCP checksum offload for TX according to the flag in wlan cfg module, which is determined by INI (MCL) or initialization setting(WIN). CRs-Fixed: 2155236 Change-Id: I0e30fc062a000c2d9c47674fe80da59a2ac0de51 --- dp/wifi3.0/dp_tx.c | 6 ++++-- wlan_cfg/wlan_cfg.c | 7 +++++++ wlan_cfg/wlan_cfg.h | 8 ++++++++ 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/dp/wifi3.0/dp_tx.c b/dp/wifi3.0/dp_tx.c index ba834025780e..6fd6a842e21b 100644 --- a/dp/wifi3.0/dp_tx.c +++ b/dp/wifi3.0/dp_tx.c @@ -828,8 +828,10 @@ static QDF_STATUS dp_tx_hw_enqueue(struct dp_soc *soc, struct dp_vdev *vdev, hal_tx_desc_set_addr_search_flags(hal_tx_desc_cached, vdev->hal_desc_addr_search_flags); - if ((qdf_nbuf_get_tx_cksum(tx_desc->nbuf) == QDF_NBUF_TX_CKSUM_TCP_UDP) - || qdf_nbuf_is_tso(tx_desc->nbuf)) { + /* verify checksum offload configuration*/ + if ((wlan_cfg_get_checksum_offload(soc->wlan_cfg_ctx)) && + ((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); hal_tx_desc_set_l4_checksum_en(hal_tx_desc_cached, 1); } diff --git a/wlan_cfg/wlan_cfg.c b/wlan_cfg/wlan_cfg.c index c83803dd35fe..a23d2b0ba652 100644 --- a/wlan_cfg/wlan_cfg.c +++ b/wlan_cfg/wlan_cfg.c @@ -348,6 +348,8 @@ struct wlan_cfg_dp_soc_ctxt *wlan_cfg_soc_attach() wlan_cfg_set_hw_macid(wlan_cfg_ctx, 2, 2); wlan_cfg_ctx->base_hw_macid = 1; + /*Enable checksum offload by default*/ + wlan_cfg_ctx->tcp_udp_checksumoffload = 1; return wlan_cfg_ctx; } @@ -690,6 +692,11 @@ int wlan_cfg_get_int_timer_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg) { return cfg->int_timer_threshold_other; } + +int wlan_cfg_get_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg) +{ + return cfg->tcp_udp_checksumoffload; +} #ifdef QCA_LL_TX_FLOW_CONTROL_V2 /** * wlan_cfg_get_tx_flow_stop_queue_th() - Get flow control stop threshold diff --git a/wlan_cfg/wlan_cfg.h b/wlan_cfg/wlan_cfg.h index 607af19c3955..19d1868f3f0a 100644 --- a/wlan_cfg/wlan_cfg.h +++ b/wlan_cfg/wlan_cfg.h @@ -626,6 +626,14 @@ int wlan_cfg_get_int_batch_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg); */ int wlan_cfg_get_int_timer_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg); +/* + * wlan_cfg_get_checksum_offload - Get checksum offload enable or disable status + * @wlan_cfg_soc_ctx + * + * Return: Checksum offload enable or disable + */ +int wlan_cfg_get_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