msm: ipa3: Fix to handle zero length frag skb packet

Due to zero length skb packet IPA HW going to stall state.
Adding changes to avoid sending these zero length SKB frag
packets to HW.

Change-Id: I4dae51bf767588095bc1fcd9e10196e913299227
Signed-off-by: Ashok Vuyyuru <avuyyuru@codeaurora.org>
This commit is contained in:
Ashok Vuyyuru 2021-08-30 22:15:35 +05:30
parent d38ae1ea7c
commit 1f9481a658
3 changed files with 24 additions and 14 deletions

View file

@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2012-2020, The Linux Foundation. All rights reserved.
* Copyright (c) 2012-2021, The Linux Foundation. All rights reserved.
*/
#ifdef CONFIG_DEBUG_FS
@ -1249,8 +1249,9 @@ static ssize_t ipa3_read_stats(struct file *file, char __user *ubuf,
"lan_rx_empty=%u\n"
"lan_repl_rx_empty=%u\n"
"flow_enable=%u\n"
"flow_disable=%u\n",
"rx_page_drop_cnt=%u\n",
"flow_disable=%u\n"
"rx_page_drop_cnt=%u\n"
"zero_len_frag_pkt_cnt=%u\n",
ipa3_ctx->stats.tx_sw_pkts,
ipa3_ctx->stats.tx_hw_pkts,
ipa3_ctx->stats.tx_non_linear,
@ -1267,7 +1268,8 @@ static ssize_t ipa3_read_stats(struct file *file, char __user *ubuf,
ipa3_ctx->stats.lan_repl_rx_empty,
ipa3_ctx->stats.flow_enable,
ipa3_ctx->stats.flow_disable,
ipa3_ctx->stats.rx_page_drop_cnt);
ipa3_ctx->stats.rx_page_drop_cnt,
ipa3_ctx->stats.zero_len_frag_pkt_cnt);
cnt += nbytes;
for (i = 0; i < IPAHAL_PKT_STATUS_EXCEPTION_MAX; i++) {

View file

@ -1725,22 +1725,29 @@ int ipa3_tx_dp(enum ipa_client_type dst, struct sk_buff *skb,
data_idx++;
for (f = 0; f < num_frags; f++) {
desc[data_idx + f].frag = &skb_shinfo(skb)->frags[f];
desc[data_idx + f].type = IPA_DATA_DESC_SKB_PAGED;
desc[data_idx + f].len =
skb_frag_size(desc[data_idx + f].frag);
if (skb_frag_size(&skb_shinfo(skb)->frags[f]) != 0) {
desc[data_idx].frag =
&skb_shinfo(skb)->frags[f];
desc[data_idx].type =
IPA_DATA_DESC_SKB_PAGED;
desc[data_idx].len =
skb_frag_size(desc[data_idx].frag);
data_idx++;
} else {
IPAERR_RL("Received zero len SKB frag pkt\n");
IPA_STATS_INC_CNT(
ipa3_ctx->stats.zero_len_frag_pkt_cnt);
}
}
/* don't free skb till frag mappings are released */
if (num_frags) {
desc[data_idx + f - 1].callback =
desc[skb_idx].callback;
desc[data_idx + f - 1].user1 = desc[skb_idx].user1;
desc[data_idx + f - 1].user2 = desc[skb_idx].user2;
desc[data_idx - 1].callback = desc[skb_idx].callback;
desc[data_idx - 1].user1 = desc[skb_idx].user1;
desc[data_idx - 1].user2 = desc[skb_idx].user2;
desc[skb_idx].callback = NULL;
}
if (unlikely(ipa3_send(sys, num_frags + data_idx,
desc, true))) {
if (unlikely(ipa3_send(sys, data_idx, desc, true))) {
IPAERR_RL("fail to send skb %pK num_frags %u SWP\n",
skb, num_frags);
goto fail_send;

View file

@ -1381,6 +1381,7 @@ struct ipa3_stats {
u32 flow_disable;
u32 tx_non_linear;
u32 rx_page_drop_cnt;
u32 zero_len_frag_pkt_cnt;
struct ipa3_page_recycle_stats page_recycle_stats[2];
};