diff --git a/components/dp/core/inc/wlan_dp_txrx.h b/components/dp/core/inc/wlan_dp_txrx.h index 55995aed78..6747c7566c 100644 --- a/components/dp/core/inc/wlan_dp_txrx.h +++ b/components/dp/core/inc/wlan_dp_txrx.h @@ -423,6 +423,7 @@ void dp_get_tx_resource(struct wlan_dp_intf *dp_intf, struct qdf_mac_addr *mac_addr); #else +#if (LINUX_VERSION_CODE > KERNEL_VERSION(3, 19, 0)) /** * dp_nbuf_orphan() - skb_unshare a cloned packed else skb_orphan * @dp_intf: pointer to DP interface @@ -434,17 +435,13 @@ static inline qdf_nbuf_t dp_nbuf_orphan(struct wlan_dp_intf *dp_intf, qdf_nbuf_t nbuf) { - qdf_nbuf_t nskb; -#if (LINUX_VERSION_CODE > KERNEL_VERSION(3, 19, 0)) struct wlan_dp_psoc_context *dp_ctx = dp_intf->dp_ctx; -#endif int cpu; dp_nbuf_fill_gso_size(dp_intf->dev, nbuf); - nskb = __qdf_nbuf_unshare(nbuf); -#if (LINUX_VERSION_CODE > KERNEL_VERSION(3, 19, 0)) - if (unlikely(dp_ctx->dp_cfg.tx_orphan_enable) && nskb == nbuf) { + if (unlikely(dp_ctx->dp_cfg.tx_orphan_enable) || + qdf_nbuf_is_cloned(nbuf)) { /* * For UDP packets we want to orphan the packet to allow the app * to send more packets. The flow would ultimately be controlled @@ -454,9 +451,21 @@ qdf_nbuf_t dp_nbuf_orphan(struct wlan_dp_intf *dp_intf, ++dp_intf->dp_stats.tx_rx_stats.per_cpu[cpu].tx_orphaned; qdf_nbuf_orphan(nbuf); } -#endif + return nbuf; +} +#else +static inline +qdf_nbuf_t dp_nbuf_orphan(struct wlan_dp_intf *dp_intf, + qdf_nbuf_t nbuf) +{ + qdf_nbuf_t nskb; + + dp_nbuf_fill_gso_size(dp_intf->dev, nbuf); + nskb = __qdf_nbuf_unshare(nbuf); + return nskb; } +#endif /** * dp_get_tx_resource() - check tx resources and take action