Skip to content

Commit

Permalink
tests: add --queue_cnt to set the queues number for port (#561)
Browse files Browse the repository at this point in the history
test with: ./build/tests/KahawaiTest --p_port native_af_xdp:enp0s3np0
--r_port native_af_xdp:enp0s4np0 --queue_cnt=8 --start_queue 3

Signed-off-by: Frank Du <[email protected]>
  • Loading branch information
frankdjx authored Nov 2, 2023
1 parent 24c995f commit 6f71b56
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 5 deletions.
20 changes: 20 additions & 0 deletions doc/run.md
Original file line number Diff line number Diff line change
Expand Up @@ -540,3 +540,23 @@ The VFIO driver can run without the IOMMU feature, enable it with below command
```bash
sudo bash -c 'echo 1 > /sys/module/vfio/parameters/enable_unsafe_noiommu_mode'
```
### 8.12 Fail to loading shared libraries
If you get below similar message when runing the RxTxApp, it's likely a ld library path problem.

```bash
./build/app/RxTxApp: error while loading shared libraries: librte_dmadev.so.23: cannot open shared object file: No such file or directory
```
Try to find the path of this so and append it to `LD_LIBRARY_PATH`.
```bash
find / -name librte_dmadev.so.23
# /usr/local/lib64/librte_dmadev.so.23
```
```bash
# Note to change the path as the find result
export LD_LIBRARY_PATH=/usr/local/lib64/
```
6 changes: 4 additions & 2 deletions lib/src/dev/mt_af_xdp.c
Original file line number Diff line number Diff line change
Expand Up @@ -821,8 +821,10 @@ int mt_rx_xdp_put(struct mt_rx_xdp_entry* entry) {
mt_rx_flow_free(entry->parent, port, entry->flow_rsp);
entry->flow_rsp = NULL;
}
xdp_queue_rx_stat(xq);
if (xq) xq->rx_entry = NULL;
if (xq) {
xdp_queue_rx_stat(xq);
xq->rx_entry = NULL;
}
info("%s(%d), ip %u.%u.%u.%u, port %u, queue %u\n", __func__, port, ip[0], ip[1], ip[2],
ip[3], flow->dst_port, entry->queue_id);
mt_rte_free(entry);
Expand Down
4 changes: 3 additions & 1 deletion lib/src/dev/mt_af_xdp.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ uint16_t mt_rx_xdp_burst(struct mt_rx_xdp_entry* entry, struct rte_mbuf** rx_pkt
const uint16_t nb_pkts);
#else

#include "../mt_log.h"

static inline int mt_dev_xdp_init(struct mt_interface* inf) {
MTL_MAY_UNUSED(inf);
err("%s(%d), no xdp support for this build\n", __func__, inf->port);
return -ENOTSUP;
}

Expand Down
19 changes: 19 additions & 0 deletions script/if_filter_delete.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2023 Intel Corporation

set -e

if [ $# -lt 1 ]; then
echo "Please specify the network interface"
exit 0
fi

if_name=$1

echo "Start to delete all filters for $if_name"
for rule in $(ethtool -n "$if_name" | grep 'Filter:' | awk '{print $2}'); do
echo "Delete filter $rule"
ethtool -N "$if_name" delete "$rule"
done
4 changes: 2 additions & 2 deletions tests/src/st20_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3645,8 +3645,8 @@ TEST(St20_rx, detect_uframe_mix_s2) {
enum st20_type rx_type[2] = {ST20_TYPE_FRAME_LEVEL, ST20_TYPE_SLICE_LEVEL};
enum st20_packing packing[2] = {ST20_PACKING_BPM, ST20_PACKING_BPM};
enum st_fps fps[2] = {ST_FPS_P59_94, ST_FPS_P29_97};
int width[2] = {1280, 1920};
int height[2] = {720, 1080};
int width[2] = {1280, 1280};
int height[2] = {720, 720};
bool interlaced[2] = {false, false};
st20_rx_detect_test(tx_type, rx_type, packing, fps, width, height, interlaced, true,
ST20_FMT_YUV_422_10BIT, false, ST_TEST_LEVEL_MANDATORY, 2);
Expand Down
10 changes: 10 additions & 0 deletions tests/src/tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ enum test_args_cmd {
TEST_ARG_START_QUEUE,
TEST_ARG_P_START_QUEUE,
TEST_ARG_R_START_QUEUE,
TEST_ARG_QUEUE_CNT,
TEST_ARG_HDR_SPLIT,
TEST_ARG_TASKLET_THREAD,
TEST_ARG_TSC_PACING,
Expand Down Expand Up @@ -68,6 +69,7 @@ static struct option test_args_options[] = {
{"auto_start_stop", no_argument, 0, TEST_ARG_AUTO_START_STOP},
{"afxdp_zc_disable", no_argument, 0, TEST_ARG_AF_XDP_ZC_DISABLE},
{"start_queue", required_argument, 0, TEST_ARG_START_QUEUE},
{"queue_cnt", required_argument, 0, TEST_ARG_QUEUE_CNT},
{"p_start_queue", required_argument, 0, TEST_ARG_P_START_QUEUE},
{"r_start_queue", required_argument, 0, TEST_ARG_R_START_QUEUE},
{"hdr_split", no_argument, 0, TEST_ARG_HDR_SPLIT},
Expand Down Expand Up @@ -208,6 +210,14 @@ static int test_parse_args(struct st_tests_context* ctx, struct mtl_init_params*
case TEST_ARG_R_START_QUEUE:
p->xdp_info[MTL_PORT_R].start_queue = atoi(optarg);
break;
case TEST_ARG_QUEUE_CNT: {
uint16_t cnt = atoi(optarg);
p->tx_queues_cnt[MTL_PORT_P] = cnt;
p->tx_queues_cnt[MTL_PORT_R] = cnt;
p->rx_queues_cnt[MTL_PORT_P] = cnt;
p->rx_queues_cnt[MTL_PORT_R] = cnt;
break;
}
case TEST_ARG_HDR_SPLIT:
ctx->hdr_split = true;
break;
Expand Down

0 comments on commit 6f71b56

Please sign in to comment.