Merge 338eb798c7 on remote branch

Change-Id: I6026b6826b1f78bc1c199431a9affd1169576d65
This commit is contained in:
Linux Build Service Account 2023-04-19 01:30:07 -07:00
commit 0bdd85a80d
7 changed files with 48 additions and 11 deletions

View file

@ -1,6 +1,7 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2018-2021, The Linux Foundation. All rights reserved.
* Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
*/
#include <linux/debugfs.h>
@ -762,8 +763,6 @@ static void ipa_gsb_tx_dp_notify(void *priv, enum ipa_dp_evt_type evt,
/* fetch iface handle from header */
mux_hdr = (struct ipa_gsb_mux_hdr *)skb->data;
/* change to host order */
*(u32 *)mux_hdr = ntohl(*(u32 *)mux_hdr);
hdl = mux_hdr->iface_hdl;
if ((hdl < 0) || (hdl >= MAX_SUPPORTED_IFACE) ||
!ipa_gsb_ctx->iface[hdl]) {
@ -1215,9 +1214,9 @@ static int ipa_bridge_tx_dp_internal(u32 hdl, struct sk_buff *skb,
/* add 4 byte header for mux */
mux_hdr = (struct ipa_gsb_mux_hdr *)skb_push(skb,
sizeof(struct ipa_gsb_mux_hdr));
memset(mux_hdr, 0, sizeof(struct ipa_gsb_mux_hdr));
mux_hdr->iface_hdl = (u8)hdl;
/* change to network order */
*(u32 *)mux_hdr = htonl(*(u32 *)mux_hdr);
mux_hdr->qmap_id = (u8)ipa3_get_qmap_id(ipa_gsb_ctx->prod_hdl);
ret = ipa_tx_dp(IPA_CLIENT_ODU_PROD, skb, metadata);
if (ret) {

View file

@ -1,6 +1,7 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2012-2020, The Linux Foundation. All rights reserved.
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
*/
#ifdef CONFIG_DEBUG_FS
@ -1359,6 +1360,7 @@ static ssize_t ipa3_read_stats(struct file *file, char __user *ubuf,
"flow_disable=%u\n"
"rx_page_drop_cnt=%u\n"
"lower_order=%u\n",
"pipe_setup_fail_cnt=%u\n",
ipa3_ctx->stats.tx_sw_pkts,
ipa3_ctx->stats.tx_hw_pkts,
ipa3_ctx->stats.tx_non_linear,
@ -1376,7 +1378,8 @@ static ssize_t ipa3_read_stats(struct file *file, char __user *ubuf,
ipa3_ctx->stats.flow_enable,
ipa3_ctx->stats.flow_disable,
ipa3_ctx->stats.rx_page_drop_cnt,
ipa3_ctx->stats.lower_order
ipa3_ctx->stats.lower_order,
ipa3_ctx->stats.pipe_setup_fail_cnt
);
cnt += nbytes;

View file

@ -1383,10 +1383,14 @@ int ipa3_setup_sys_pipe(struct ipa_sys_connect_params *sys_in, u32 *clnt_hdl)
fail_gen3:
ipa3_disable_data_path(ipa_ep_idx);
fail_repl:
ep->sys->repl_hdlr = ipa3_replenish_rx_cache;
ep->sys->repl->capacity = 0;
kfree(ep->sys->repl);
ep->sys->repl = NULL;
if (IPA_CLIENT_IS_CONS(ep->client))
ipa3_cleanup_rx(ep->sys);
if(ep->sys->repl) {
ep->sys->repl->capacity = 0;
kfree(ep->sys->repl);
ep->sys->repl = NULL;
}
fail_page_recycle_repl:
if (ep->sys->page_recycle_repl) {
ep->sys->page_recycle_repl->capacity = 0;
@ -1410,6 +1414,7 @@ fail_wq:
fail_and_disable_clocks:
IPA_ACTIVE_CLIENTS_DEC_EP(sys_in->client);
fail_gen:
IPA_STATS_INC_CNT(ipa3_ctx->stats.pipe_setup_fail_cnt);
return result;
}

View file

@ -1,6 +1,7 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2012-2021, The Linux Foundation. All rights reserved.
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
*/
#include "ipa_i.h"
@ -94,8 +95,10 @@ static int ipa3_hdr_proc_ctx_to_hw_format(struct ipa_mem_buffer *mem,
if (unlikely(!entry->hdr || !entry->hdr->offset_entry ||
!entry->offset_entry ||
entry->hdr->hdr_len == 0 ||
entry->hdr->hdr_len > ipa_hdr_bin_sz[IPA_HDR_BIN_MAX - 1]))
entry->hdr->hdr_len > ipa_hdr_bin_sz[IPA_HDR_BIN_MAX - 1])) {
IPAERR_RL("Found invalid hdr entry\n");
return -EINVAL;
}
ret = ipahal_cp_proc_ctx_to_hw_buff(entry->type, mem->base,
entry->offset_entry->offset,
@ -128,6 +131,7 @@ static int ipa3_generate_hdr_proc_ctx_hw_tbl(u64 hdr_sys_addr,
{
u64 hdr_base_addr;
gfp_t flag = GFP_KERNEL;
int ret;
mem->size = (ipa3_ctx->hdr_proc_ctx_tbl.end) ? : 4;
@ -156,7 +160,12 @@ alloc:
memset(aligned_mem->base, 0, aligned_mem->size);
hdr_base_addr = (ipa3_ctx->hdr_tbl_lcl) ? IPA_MEM_PART(apps_hdr_ofst) :
hdr_sys_addr;
return ipa3_hdr_proc_ctx_to_hw_format(aligned_mem, hdr_base_addr);
ret = ipa3_hdr_proc_ctx_to_hw_format(aligned_mem, hdr_base_addr);
if (ret) {
dma_free_coherent(ipa3_ctx->pdev, mem->size, mem->base, mem->phys_base);
return ret;
}
return ret;
}
/**

View file

@ -1,6 +1,7 @@
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (c) 2012-2021, The Linux Foundation. All rights reserved.
* Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
*/
#ifndef _IPA3_I_H_
@ -1449,6 +1450,7 @@ struct ipa3_stats {
u32 rx_page_drop_cnt;
struct ipa3_page_recycle_stats page_recycle_stats[2];
u64 lower_order;
u32 pipe_setup_fail_cnt;
};
/* offset for each stats */
@ -2813,6 +2815,7 @@ bool ipa3_is_client_handle_valid(u32 clnt_hdl);
enum ipa_client_type ipa3_get_client_mapping(int pipe_idx);
enum ipa_client_type ipa3_get_client_by_pipe(int pipe_idx);
u32 ipa3_get_qmap_id(int pipe_idx);
void ipa_init_ep_flt_bitmap(void);

View file

@ -1,6 +1,7 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2012-2021, The Linux Foundation. All rights reserved.
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved
*/
#include <net/ip.h>
@ -9615,6 +9616,20 @@ u32 ipa3_get_r_rev_version(void)
}
EXPORT_SYMBOL(ipa3_get_r_rev_version);
u32 ipa3_get_qmap_id(int pipe_idx)
{
if (pipe_idx >= ipa3_ctx->ipa_num_pipes || pipe_idx < 0) {
IPAERR("Bad pipe index!\n");
WARN_ON(1);
return -EINVAL;
}
return ipa3_ctx->ep[pipe_idx].cfg.meta.qmap_id;
}
EXPORT_SYMBOL(ipa3_get_qmap_id);
/**
* ipa3_ctx_get_type() - to get platform type, hw type
* and hw mode

View file

@ -1,6 +1,8 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2014-2021, The Linux Foundation. All rights reserved.
*
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
*/
/*
@ -1402,6 +1404,7 @@ static void apps_ipa_packet_receive_notify(void *priv,
skb->dev = IPA_NETDEV();
skb->protocol = htons(ETH_P_MAP);
skb_set_mac_header(skb, 0);
skb_reset_network_header(skb);
if (ipa3_rmnet_res.ipa_napi_enable) {
trace_rmnet_ipa_netif_rcv_skb3(skb, dev->stats.rx_packets);