msm: ipa: Add TTL update test cases
Add basic IPv4 and Ipv6 test cases for TTL update in HW based on filtering and routing rules. Also, consists of several minor fixes during bring up. Change-Id: Ib363434b20ad2fc8cf29c78bb5db667959f2dbfd Signed-off-by: Chaitanya Pratapa <cpratapa@codeaurora.org>
This commit is contained in:
committed by
Gerrit - the friendly Code Review server
parent
ec06323b3c
commit
49c10e18c6
@@ -1,6 +1,7 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <linux/types.h> /* u32 */
|
||||
@@ -350,7 +351,7 @@ static ssize_t channel_write_gsi(struct file *filp, const char __user *buf,
|
||||
int res = 0;
|
||||
void *data_address = channel_dev->mem.base
|
||||
+ channel_dev->mem_buff_index * TX_BUFF_SIZE;
|
||||
u32 data_phys_addr = channel_dev->mem.phys_base
|
||||
u64 data_phys_addr = channel_dev->mem.phys_base
|
||||
+ channel_dev->mem_buff_index * TX_BUFF_SIZE;
|
||||
struct gsi_xfer_elem gsi_xfer;
|
||||
|
||||
@@ -413,7 +414,7 @@ static ssize_t channel_read_gsi(struct file *filp, char __user *buf,
|
||||
break;
|
||||
|
||||
IPATEST_DBG("channel empty %d/%d\n", i + 1, max_retry);
|
||||
msleep(5);
|
||||
msleep(1000);
|
||||
}
|
||||
|
||||
if (i == max_retry) {
|
||||
@@ -449,6 +450,8 @@ static ssize_t channel_read_gsi(struct file *filp, char __user *buf,
|
||||
return 0;
|
||||
}
|
||||
|
||||
msleep(20);
|
||||
|
||||
IPATEST_DBG("Returning %d.\n", xfer_notify.bytes_xfered);
|
||||
return xfer_notify.bytes_xfered;
|
||||
}
|
||||
@@ -2741,13 +2744,6 @@ int configure_system_7(void)
|
||||
|
||||
memset(&ipa_ep_cfg, 0, sizeof(ipa_ep_cfg));
|
||||
|
||||
res = exception_hdl_init();
|
||||
if (0 != res) {
|
||||
IPATEST_ERR("exception_hdl_init() failed (%d)\n", res);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
/* Connect first Rx IPA --> APPS MEM */
|
||||
memset(&sys_in, 0, sizeof(sys_in));
|
||||
sys_in.client = IPA_CLIENT_TEST2_CONS;
|
||||
@@ -3134,7 +3130,8 @@ int configure_system_20(void)
|
||||
u32 ipa_pipe_num;
|
||||
|
||||
memset(&ipa_ep_cfg, 0, sizeof(ipa_ep_cfg));
|
||||
|
||||
ipa_ep_cfg.hdr.hdr_len = 18;
|
||||
sys_in.ipa_ep_cfg = ipa_ep_cfg;
|
||||
|
||||
/* Connect first Rx IPA --> AP MEM */
|
||||
memset(&sys_in, 0, sizeof(sys_in));
|
||||
@@ -4215,6 +4212,8 @@ static int configure_app_to_ipa_path(struct ipa_channel_config __user *to_ipa_us
|
||||
/* Connect IPA --> Apps */
|
||||
memset(&sys_in, 0, sizeof(sys_in));
|
||||
sys_in.client = to_ipa_channel_config.client;
|
||||
sys_in.notify = ¬ify_upon_exception;
|
||||
sys_in.priv = &(p_exception_hdl_data->notify_cb_data);
|
||||
IPATEST_DBG("copying from 0x%px\n", to_ipa_channel_config.cfg);
|
||||
retval = copy_from_user(&sys_in.ipa_ep_cfg, to_ipa_channel_config.cfg, to_ipa_channel_config.config_size);
|
||||
if (retval) {
|
||||
@@ -4379,6 +4378,12 @@ static int configure_test_scenario(
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
if (isUlso) {
|
||||
rx_size = RX_SZ_ULSO;
|
||||
} else {
|
||||
rx_size = RX_SZ;
|
||||
}
|
||||
|
||||
for (i = 0 ; i < ipa_test_config_header->from_ipa_channels_num ; i++) {
|
||||
IPATEST_DBG("starting configuration of from_ipa_%d\n", i);
|
||||
retval = configure_app_from_ipa_path(from_ipa_channel_config_array[i], isUlso);
|
||||
@@ -4388,12 +4393,6 @@ static int configure_test_scenario(
|
||||
}
|
||||
}
|
||||
|
||||
if (isUlso) {
|
||||
rx_size = RX_SZ_ULSO;
|
||||
} else {
|
||||
rx_size = RX_SZ;
|
||||
}
|
||||
|
||||
retval = insert_descriptors_into_rx_endpoints(RX_BUFF_SIZE);
|
||||
if (retval) {
|
||||
IPATEST_ERR("RX descriptors failed\n");
|
||||
@@ -4426,33 +4425,41 @@ fail:
|
||||
|
||||
static int handle_add_hdr_hpc(unsigned long ioctl_arg)
|
||||
{
|
||||
struct ipa_ioc_add_hdr hdrs;
|
||||
struct ipa_ioc_add_hdr *hdrs;
|
||||
struct ipa_hdr_add *hdr;
|
||||
int retval;
|
||||
|
||||
IPATEST_ERR("copying from 0x%px\n", (u8 *)ioctl_arg);
|
||||
retval = copy_from_user(&hdrs, (u8 *)ioctl_arg, sizeof(hdrs) + sizeof(*hdr));
|
||||
hdrs = kzalloc(sizeof(struct ipa_ioc_add_hdr) + sizeof(struct ipa_hdr_add), GFP_KERNEL);
|
||||
if (!hdrs)
|
||||
return -ENOMEM;
|
||||
retval = copy_from_user(hdrs, (u8 *)ioctl_arg,
|
||||
sizeof(struct ipa_ioc_add_hdr) + sizeof(struct ipa_hdr_add));
|
||||
if (retval) {
|
||||
IPATEST_ERR("failing copying header from user\n");
|
||||
kfree(hdrs);
|
||||
return retval;
|
||||
}
|
||||
retval = ipa3_add_hdr_hpc(&hdrs);
|
||||
retval = ipa3_add_hdr_hpc(hdrs);
|
||||
if (retval) {
|
||||
IPATEST_ERR("ipa3_add_hdr_hpc failed\n");
|
||||
kfree(hdrs);
|
||||
return retval;
|
||||
}
|
||||
IPATEST_ERR("ELIAD: \n");
|
||||
hdr = &hdrs.hdr[0];
|
||||
hdr = &hdrs->hdr[0];
|
||||
if (hdr->status) {
|
||||
IPATEST_ERR("ipa3_add_hdr_hpc failed\n");
|
||||
return hdr->status;
|
||||
}
|
||||
IPATEST_ERR("ELIAD: \n");
|
||||
if (copy_to_user((void __user *)ioctl_arg, &hdrs, sizeof(hdrs) + sizeof(*hdr))) {
|
||||
if (copy_to_user((void __user *)ioctl_arg, hdrs,
|
||||
sizeof(struct ipa_ioc_add_hdr) + sizeof(struct ipa_hdr_add))) {
|
||||
retval = -EFAULT;
|
||||
}
|
||||
IPATEST_ERR("ELIAD: \n");
|
||||
|
||||
kfree(hdrs);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -4814,6 +4821,10 @@ static int __init ipa_test_init(void)
|
||||
if (ret != 0)
|
||||
IPATEST_DBG("datapath_ds_init() failed (%d)\n", ret);
|
||||
|
||||
ret = exception_hdl_init();
|
||||
if (ret != 0)
|
||||
IPATEST_DBG("exception_hdl_init() failed (%d)\n", ret);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -25,6 +25,40 @@
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* Changes from Qualcomm Innovation Center are provided under the following license:
|
||||
*
|
||||
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted (subject to the limitations in the
|
||||
* disclaimer below) provided that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
*
|
||||
* * Neither the name of Qualcomm Innovation Center, Inc. nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
|
||||
* GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
|
||||
* HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
||||
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
@@ -47,8 +81,8 @@ using namespace std;
|
||||
extern Logger g_Logger;
|
||||
|
||||
static uint8_t IPv4Packet[IP4_PACKET_SIZE] = {
|
||||
0x45, 0x00, 0x00, 0x29,
|
||||
0x00, 0x00, 0x40, 0x00,
|
||||
0x45, 0x00, 0x00, 0x46,
|
||||
0x45, 0x00, 0x00, 0x00,
|
||||
0xff, 0x06, 0xf5, 0xfd,// Protocol = 06 (TCP)
|
||||
0xc0, 0xa8, 0x02, 0x13,// IPv4 SRC Addr 192.168.2.19
|
||||
0xc0, 0xa8, 0x02, 0x68,// IPv4 DST Addr 192.168.2.104
|
||||
@@ -117,7 +151,7 @@ static const uint8_t Eth2IPv4Packet[] =
|
||||
0x08, 0x00, // ETH2 TYPE IPv4 - ETH_P_IP 0x0800
|
||||
|
||||
// IPv4
|
||||
0x45, 0x00, 0x00, 0x2e,
|
||||
0x45, 0x00, 0x00, 0x29,
|
||||
0x00, 0x00, 0x40, 0x00,
|
||||
0xff, 0x06, 0xf5, 0xfd, // Protocol = 06 (TCP)
|
||||
0xc0, 0xa8, 0x02, 0x13, // IPv4 SRC Addr 192.168.2.19
|
||||
@@ -161,7 +195,7 @@ static const uint8_t WLANEth2IPv4Packet[] =
|
||||
0x08, 0x00, // ETH2 TYPE IPv4 - ETH_P_IP 0x0800
|
||||
|
||||
// IPv4
|
||||
0x45, 0x00, 0x00, 0x2e,
|
||||
0x45, 0x00, 0x00, 0x29,
|
||||
0x00, 0x00, 0x40, 0x00,
|
||||
0xff, 0x06, 0xf5, 0xfd, // Protocol = 06 (TCP)
|
||||
0xc0, 0xa8, 0x02, 0x13, // IPv4 SRC Addr 192.168.2.19
|
||||
@@ -188,7 +222,7 @@ static const uint8_t WLAN802_3IPv4Packet[] =
|
||||
0x08, 0x00, // Ethrtype - 0x0800
|
||||
|
||||
// IPv4
|
||||
0x45, 0x00, 0x00, 0x2e,
|
||||
0x45, 0x00, 0x00, 0x29,
|
||||
0x00, 0x00, 0x40, 0x00,
|
||||
0xff, 0x06, 0xf5, 0xfd, // Protocol = 06 (TCP)
|
||||
0xc0, 0xa8, 0x02, 0x13, // IPv4 SRC Addr 192.168.2.19
|
||||
@@ -1221,13 +1255,36 @@ bool CompareResultVsGolden(Byte *goldenBuffer, unsigned int goldenSize,
|
||||
return !memcmp((void*)receivedBuffer, (void*)goldenBuffer, goldenSize);
|
||||
}
|
||||
|
||||
size_t GetPacketStatusSize(void)
|
||||
{
|
||||
switch (TestManager::GetInstance()->GetIPAHwType()) {
|
||||
case IPA_HW_v5_5:
|
||||
return sizeof(struct ipa3_hw_pkt_status_hw_v5_5);
|
||||
case IPA_HW_v5_0:
|
||||
case IPA_HW_v5_1:
|
||||
return sizeof(struct ipa3_hw_pkt_status_hw_v5_0);
|
||||
default:
|
||||
return sizeof(struct ipa3_hw_pkt_status);
|
||||
}
|
||||
}
|
||||
|
||||
bool CompareResultVsGolden_w_Status(Byte *goldenBuffer, unsigned int goldenSize,
|
||||
Byte *receivedBuffer, unsigned int receivedSize)
|
||||
{
|
||||
size_t stts_size = sizeof(struct ipa3_hw_pkt_status);
|
||||
|
||||
if (TestManager::GetInstance()->GetIPAHwType() >= IPA_HW_v5_0) {
|
||||
stts_size = sizeof(struct ipa3_hw_pkt_status_hw_v5_0);
|
||||
switch (TestManager::GetInstance()->GetIPAHwType()) {
|
||||
case IPA_HW_v5_5:
|
||||
stts_size = sizeof(struct ipa3_hw_pkt_status_hw_v5_5);
|
||||
break;
|
||||
case IPA_HW_v5_0:
|
||||
case IPA_HW_v5_1:
|
||||
stts_size = sizeof(struct ipa3_hw_pkt_status_hw_v5_0);
|
||||
break;
|
||||
default:
|
||||
stts_size = sizeof(struct ipa3_hw_pkt_status);
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
if ((receivedSize - stts_size) != goldenSize) {
|
||||
|
@@ -25,6 +25,40 @@
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* Changes from Qualcomm Innovation Center are provided under the following license:
|
||||
*
|
||||
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted (subject to the limitations in the
|
||||
* disclaimer below) provided that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
*
|
||||
* * Neither the name of Qualcomm Innovation Center, Inc. nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
|
||||
* GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
|
||||
* HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
||||
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
|
||||
*/
|
||||
|
||||
#include <getopt.h>
|
||||
@@ -49,7 +83,7 @@ string sFormat = "ip_accelerator <control_flag> <suit/name>, ..., <suit/name>\n"
|
||||
"ip_accelerator " SHOW_SUIT_FLAG "\n"
|
||||
"or ip_accelerator --chooser "
|
||||
"for menu chooser interface\n";
|
||||
#define MAX_SUITES 17
|
||||
#define MAX_SUITES 19
|
||||
|
||||
#undef strcasesame
|
||||
#define strcasesame(x, y) \
|
||||
|
Reference in New Issue
Block a user