From dd62a46e9f38706d67ee45e09474bf7ccc29f60e Mon Sep 17 00:00:00 2001 From: Akshay Pandit Date: Fri, 18 Oct 2019 13:28:22 +0530 Subject: [PATCH] msm: ipa3: Ratelimit the error logs for pkts with invalid status Ratelimit the logs indicating invalid packet status fields. Support DL Frag rule status opcode. The logs introduces delay during modem ssr. Change-Id: I92ebf8776dd0e81653c968985818124cbe539d5f Signed-off-by: Akshay Pandit --- drivers/platform/msm/ipa/ipa_v3/ipa_dp.c | 23 ++++++++++--------- .../platform/msm/ipa/ipa_v3/ipahal/ipahal.c | 9 +++----- 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_dp.c b/drivers/platform/msm/ipa/ipa_v3/ipa_dp.c index b70ec659dfe0..f469cf635dc7 100644 --- a/drivers/platform/msm/ipa/ipa_v3/ipa_dp.c +++ b/drivers/platform/msm/ipa/ipa_v3/ipa_dp.c @@ -2744,25 +2744,26 @@ begin: sys->status_stat->curr = 0; } - if ((status.status_opcode != - IPAHAL_PKT_STATUS_OPCODE_DROPPED_PACKET) && - (status.status_opcode != - IPAHAL_PKT_STATUS_OPCODE_PACKET) && - (status.status_opcode != - IPAHAL_PKT_STATUS_OPCODE_SUSPENDED_PACKET) && - (status.status_opcode != - IPAHAL_PKT_STATUS_OPCODE_PACKET_2ND_PASS)) { - IPAERR("unsupported opcode(%d)\n", + switch (status.status_opcode) { + case IPAHAL_PKT_STATUS_OPCODE_DROPPED_PACKET: + case IPAHAL_PKT_STATUS_OPCODE_PACKET: + case IPAHAL_PKT_STATUS_OPCODE_SUSPENDED_PACKET: + case IPAHAL_PKT_STATUS_OPCODE_PACKET_2ND_PASS: + case IPAHAL_PKT_STATUS_OPCODE_NEW_FRAG_RULE: + break; + default: + IPAERR_RL("unsupported opcode(%d)\n", status.status_opcode); skb_pull(skb, pkt_status_sz); continue; } + IPA_STATS_EXCP_CNT(status.exception, ipa3_ctx->stats.rx_excp_pkts); if (status.endp_dest_idx >= ipa3_ctx->ipa_num_pipes || status.endp_src_idx >= ipa3_ctx->ipa_num_pipes) { - IPAERR("status fields invalid\n"); - IPAERR("STATUS opcode=%d src=%d dst=%d len=%d\n", + IPAERR_RL("status fields invalid\n"); + IPAERR_RL("STATUS opcode=%d src=%d dst=%d len=%d\n", status.status_opcode, status.endp_src_idx, status.endp_dest_idx, status.pkt_len); WARN_ON(1); diff --git a/drivers/platform/msm/ipa/ipa_v3/ipahal/ipahal.c b/drivers/platform/msm/ipa/ipa_v3/ipahal/ipahal.c index 0b0545e59ec4..c93e60cb1d73 100644 --- a/drivers/platform/msm/ipa/ipa_v3/ipahal/ipahal.c +++ b/drivers/platform/msm/ipa/ipa_v3/ipahal/ipahal.c @@ -926,9 +926,8 @@ static void ipa_pkt_status_parse( opcode = IPAHAL_PKT_STATUS_OPCODE_PACKET_2ND_PASS; break; default: - IPAHAL_ERR("unsupported Status Opcode 0x%x\n", + IPAHAL_ERR_RL("unsupported Status Opcode 0x%x\n", hw_status->status_opcode); - WARN_ON(1); } status->status_opcode = opcode; @@ -943,9 +942,8 @@ static void ipa_pkt_status_parse( status->nat_type = IPAHAL_PKT_STATUS_NAT_DST; break; default: - IPAHAL_ERR("unsupported Status NAT type 0x%x\n", + IPAHAL_ERR_RL("unsupported Status NAT type 0x%x\n", hw_status->nat_type); - WARN_ON(1); } switch (hw_status->exception) { @@ -977,9 +975,8 @@ static void ipa_pkt_status_parse( exception_type = IPAHAL_PKT_STATUS_EXCEPTION_CSUM; break; default: - IPAHAL_ERR("unsupported Status Exception type 0x%x\n", + IPAHAL_ERR_RL("unsupported Status Exception type 0x%x\n", hw_status->exception); - WARN_ON(1); } status->exception = exception_type;