From 2687c05df74cbc97b3fcc741c013e3054f0d5343 Mon Sep 17 00:00:00 2001 From: Frank Du Date: Thu, 2 Nov 2023 15:05:24 +0800 Subject: [PATCH] shared_queue: add both dpdk and xdp support test with: ./build/app/RxTxApp --config_file tests/script/native_af_xdp_json/loop_shared.json --video_sha_check Signed-off-by: Frank Du --- lib/src/datapath/mt_queue.c | 20 +-- lib/src/datapath/mt_shared_queue.c | 67 +++++++++- lib/src/dev/mt_af_xdp.c | 121 ++++++++++++------ lib/src/dev/mt_af_xdp.h | 26 +++- lib/src/mt_main.h | 14 ++ tests/script/native_af_xdp_json/loop.json | 4 +- tests/script/native_af_xdp_json/loop_4k.json | 4 +- tests/script/native_af_xdp_json/loop_rtp.json | 4 +- .../native_af_xdp_json/loop_shared.json | 107 ++++++++++++++++ tests/script/native_af_xdp_json/mcast.json | 4 +- .../script/native_af_xdp_json/redundant.json | 4 +- .../native_af_xdp_json/redundant_rtp.json | 4 +- tests/script/native_af_xdp_json/st22p.json | 4 +- .../native_af_xdp_json/st22p_redundant.json | 4 +- 14 files changed, 312 insertions(+), 75 deletions(-) create mode 100644 tests/script/native_af_xdp_json/loop_shared.json diff --git a/lib/src/datapath/mt_queue.c b/lib/src/datapath/mt_queue.c index c9b918700..a78225bc8 100644 --- a/lib/src/datapath/mt_queue.c +++ b/lib/src/datapath/mt_queue.c @@ -58,11 +58,6 @@ struct mt_rxq_entry* mt_rxq_get(struct mtl_main_impl* impl, enum mtl_port port, if (!entry->rx_socket_q) goto fail; entry->queue_id = mt_rx_socket_queue_id(entry->rx_socket_q); entry->burst = rx_socket_burst; - } else if (mt_pmd_is_native_af_xdp(impl, port)) { - entry->rx_xdp_q = mt_rx_xdp_get(impl, port, flow); - if (!entry->rx_xdp_q) goto fail; - entry->queue_id = mt_rx_xdp_queue_id(entry->rx_xdp_q); - entry->burst = rx_xdp_burst; } else if (mt_has_srss(impl, port)) { entry->srss = mt_srss_get(impl, port, flow); if (!entry->srss) goto fail; @@ -73,6 +68,11 @@ struct mt_rxq_entry* mt_rxq_get(struct mtl_main_impl* impl, enum mtl_port port, if (!entry->rsq) goto fail; entry->queue_id = mt_rsq_queue_id(entry->rsq); entry->burst = rx_rsq_burst; + } else if (mt_pmd_is_native_af_xdp(impl, port)) { + entry->rx_xdp_q = mt_rx_xdp_get(impl, port, flow, NULL); + if (!entry->rx_xdp_q) goto fail; + entry->queue_id = mt_rx_xdp_queue_id(entry->rx_xdp_q); + entry->burst = rx_xdp_burst; } else if (flow->flags & MT_RXQ_FLOW_F_FORCE_CNI) { entry->csq = mt_csq_get(impl, port, flow); if (!entry->csq) goto fail; @@ -162,16 +162,16 @@ struct mt_txq_entry* mt_txq_get(struct mtl_main_impl* impl, enum mtl_port port, if (!entry->tx_socket_q) goto fail; entry->queue_id = mt_tx_socket_queue_id(entry->tx_socket_q); entry->burst = tx_socket_burst; - } else if (mt_pmd_is_native_af_xdp(impl, port)) { - entry->tx_xdp_q = mt_tx_xdp_get(impl, port, flow); - if (!entry->tx_xdp_q) goto fail; - entry->queue_id = mt_tx_xdp_queue_id(entry->tx_xdp_q); - entry->burst = tx_xdp_burst; } else if (mt_shared_tx_queue(impl, port)) { entry->tsq = mt_tsq_get(impl, port, flow); if (!entry->tsq) goto fail; entry->queue_id = mt_tsq_queue_id(entry->tsq); entry->burst = tx_tsq_burst; + } else if (mt_pmd_is_native_af_xdp(impl, port)) { + entry->tx_xdp_q = mt_tx_xdp_get(impl, port, flow, NULL); + if (!entry->tx_xdp_q) goto fail; + entry->queue_id = mt_tx_xdp_queue_id(entry->tx_xdp_q); + entry->burst = tx_xdp_burst; } else { entry->txq = mt_dev_get_tx_queue(impl, port, flow); if (!entry->txq) goto fail; diff --git a/lib/src/datapath/mt_shared_queue.c b/lib/src/datapath/mt_shared_queue.c index d093413f5..8815761ac 100644 --- a/lib/src/datapath/mt_shared_queue.c +++ b/lib/src/datapath/mt_shared_queue.c @@ -4,6 +4,7 @@ #include "mt_shared_queue.h" +#include "../dev/mt_af_xdp.h" #include "../dev/mt_dev.h" #include "../mt_flow.h" #include "../mt_log.h" @@ -94,6 +95,11 @@ static int rsq_uinit(struct mt_rsq_impl* rsq) { MT_TAILQ_REMOVE(&rsq_queue->head, entry, next); rsq_entry_free(entry); } + + if (rsq_queue->xdp) { + mt_rx_xdp_put(rsq_queue->xdp); + rsq_queue->xdp = NULL; + } } mt_rte_free(rsq->rsq_queues); rsq->rsq_queues = NULL; @@ -173,10 +179,32 @@ struct mt_rsq_entry* mt_rsq_get(struct mtl_main_impl* impl, enum mtl_port port, entry->parent = rsqm; rte_memcpy(&entry->flow, flow, sizeof(entry->flow)); + if (rsqm->queue_mode == MT_SQ_MODE_XDP) { + rsq_lock(rsq_queue); + if (!rsq_queue->xdp) { + /* get a 1:1 mapped queue */ + struct mt_rx_xdp_get_args args; + memset(&args, 0, sizeof(args)); + args.queue_match = true; + args.queue_id = q; + args.skip_flow = true; + args.skip_udp_port_check = true; + rsq_queue->xdp = mt_rx_xdp_get(impl, port, flow, &args); + if (!rsq_queue->xdp) { + err("%s(%d:%u), xdp queue get fail\n", __func__, port, q); + rsq_unlock(rsq_queue); + mt_rte_free(entry); + return NULL; + } + } + rsq_unlock(rsq_queue); + } + if (!(flow->flags & MT_RXQ_FLOW_F_SYS_QUEUE)) { entry->flow_rsp = mt_rx_flow_create(impl, port, q, flow); if (!entry->flow_rsp) { err("%s(%u), create flow fail\n", __func__, q); + rsq_entry_free(entry); return NULL; } } @@ -188,8 +216,7 @@ struct mt_rsq_entry* mt_rsq_get(struct mtl_main_impl* impl, enum mtl_port port, RING_F_SP_ENQ | RING_F_SC_DEQ); if (!entry->ring) { err("%s(%d,%d), ring %s create fail\n", __func__, port, idx, ring_name); - if (entry->flow_rsp) mt_rx_flow_free(impl, port, entry->flow_rsp); - mt_rte_free(entry); + rsq_entry_free(entry); return NULL; } @@ -251,7 +278,10 @@ static int rsq_rx(struct mt_rsq_queue* rsq_queue) { struct rte_ipv4_hdr* ipv4; struct rte_udp_hdr* udp; - rx = rte_eth_rx_burst(rsq_queue->port_id, q, pkts, MT_SQ_BURST_SIZE); + if (rsq_queue->xdp) + rx = mt_rx_xdp_burst(rsq_queue->xdp, pkts, MT_SQ_BURST_SIZE); + else + rx = rte_eth_rx_burst(rsq_queue->port_id, q, pkts, MT_SQ_BURST_SIZE); if (rx) dbg("%s(%u), rx pkts %u\n", __func__, q, rx); rsq_queue->stat_pkts_recv += rx; @@ -326,6 +356,8 @@ int mt_rsq_init(struct mtl_main_impl* impl) { impl->rsq[i]->parent = impl; impl->rsq[i]->port = i; impl->rsq[i]->nb_rsq_queues = mt_if(impl, i)->nb_rx_q; + impl->rsq[i]->queue_mode = + mt_pmd_is_native_af_xdp(impl, i) ? MT_SQ_MODE_XDP : MT_SQ_MODE_DPDK; ret = rsq_init(impl, impl->rsq[i]); if (ret < 0) { err("%s(%d), rsq init fail\n", __func__, i); @@ -408,8 +440,11 @@ static int tsq_uinit(struct mt_tsq_impl* tsq) { mt_mempool_free(tsq_queue->tx_pool); tsq_queue->tx_pool = NULL; } + if (tsq_queue->xdp) { + mt_tx_xdp_put(tsq_queue->xdp); + tsq_queue->xdp = NULL; + } mt_pthread_mutex_destroy(&tsq_queue->mutex); - rte_spinlock_init(&tsq_queue->tx_mutex); } mt_rte_free(tsq->tsq_queues); tsq->tsq_queues = NULL; @@ -527,6 +562,23 @@ struct mt_tsq_entry* mt_tsq_get(struct mtl_main_impl* impl, enum mtl_port port, } tsq_queue->tx_pool = pool; } + if (tsqm->queue_mode == MT_SQ_MODE_XDP) { + if (!tsq_queue->xdp) { + /* get a 1:1 mapped queue */ + struct mt_tx_xdp_get_args args; + memset(&args, 0, sizeof(args)); + args.queue_match = true; + args.queue_id = q; + tsq_queue->xdp = mt_tx_xdp_get(impl, port, flow, &args); + if (!tsq_queue->xdp) { + err("%s(%d:%u), xdp queue get fail\n", __func__, port, q); + tsq_unlock(tsq_queue); + mt_rte_free(entry); + return NULL; + } + } + } + MT_TAILQ_INSERT_HEAD(&tsq_queue->head, entry, next); rte_atomic32_inc(&tsq_queue->entry_cnt); tsq_unlock(tsq_queue); @@ -582,7 +634,10 @@ uint16_t mt_tsq_burst(struct mt_tsq_entry* entry, struct rte_mbuf** tx_pkts, uint16_t tx; rte_spinlock_lock(&tsq_queue->tx_mutex); - tx = rte_eth_tx_burst(tsq_queue->port_id, tsq_queue->queue_id, tx_pkts, nb_pkts); + if (tsq_queue->xdp) + tx = mt_tx_xdp_burst(tsq_queue->xdp, tx_pkts, nb_pkts); + else + tx = rte_eth_tx_burst(tsq_queue->port_id, tsq_queue->queue_id, tx_pkts, nb_pkts); tsq_queue->stat_pkts_send += tx; rte_spinlock_unlock(&tsq_queue->tx_mutex); @@ -645,6 +700,8 @@ int mt_tsq_init(struct mtl_main_impl* impl) { impl->tsq[i]->parent = impl; impl->tsq[i]->port = i; impl->tsq[i]->nb_tsq_queues = mt_if(impl, i)->nb_tx_q; + impl->tsq[i]->queue_mode = + mt_pmd_is_native_af_xdp(impl, i) ? MT_SQ_MODE_XDP : MT_SQ_MODE_DPDK; ret = tsq_init(impl, impl->tsq[i]); if (ret < 0) { err("%s(%d), tsq init fail\n", __func__, i); diff --git a/lib/src/dev/mt_af_xdp.c b/lib/src/dev/mt_af_xdp.c index 9d9e9f87f..028f89638 100644 --- a/lib/src/dev/mt_af_xdp.c +++ b/lib/src/dev/mt_af_xdp.c @@ -522,12 +522,14 @@ static bool xdp_rx_check_pkt(struct mt_rx_xdp_entry* entry, struct rte_mbuf* pkt return false; } - uint16_t dst_port = ntohs(udp->dst_port); - if (dst_port != entry->flow.dst_port) { - xq->stat_rx_pkt_err_udp_port++; - dbg("%s(%d, %u), wrong dst_port %u expect %u\n", __func__, port, q, dst_port, - entry->flow.dst_port); - return false; + if (!entry->skip_udp_port_check) { + uint16_t dst_port = ntohs(udp->dst_port); + if (dst_port != entry->flow.dst_port) { + xq->stat_rx_pkt_err_udp_port++; + dbg("%s(%d, %u), wrong dst_port %u expect %u\n", __func__, port, q, dst_port, + entry->flow.dst_port); + return false; + } } return true; @@ -671,6 +673,7 @@ int mt_dev_xdp_init(struct mt_interface* inf) { return ret; } + inf->port_id = inf->port; inf->xdp = xdp; inf->feature |= MT_IF_FEATURE_TX_MULTI_SEGS; info("%s(%d), start queue %u cnt %u\n", __func__, port, xdp->start_queue, @@ -692,7 +695,8 @@ int mt_dev_xdp_uinit(struct mt_interface* inf) { } struct mt_tx_xdp_entry* mt_tx_xdp_get(struct mtl_main_impl* impl, enum mtl_port port, - struct mt_txq_flow* flow) { + struct mt_txq_flow* flow, + struct mt_tx_xdp_get_args* args) { if (!mt_pmd_is_native_af_xdp(impl, port)) { err("%s(%d), this pmd is not native xdp\n", __func__, port); return NULL; @@ -710,21 +714,36 @@ struct mt_tx_xdp_entry* mt_tx_xdp_get(struct mtl_main_impl* impl, enum mtl_port struct mt_xdp_priv* xdp = mt_if(impl, port)->xdp; struct mt_xdp_queue* xq = NULL; - /* find a null slot */ - mt_pthread_mutex_lock(&xdp->queues_lock); - for (uint16_t i = 0; i < xdp->queues_cnt; i++) { - if (!xdp->queues_info[i].tx_entry) { - xq = &xdp->queues_info[i]; - xq->tx_entry = entry; - break; + + if (args && args->queue_match) { + mt_pthread_mutex_lock(&xdp->queues_lock); + xq = &xdp->queues_info[args->queue_id]; + if (xq->tx_entry) { + err("%s(%d), q %u is already used\n", __func__, port, args->queue_id); + mt_pthread_mutex_unlock(&xdp->queues_lock); + mt_tx_xdp_put(entry); + return NULL; + } + xq->tx_entry = entry; + mt_pthread_mutex_unlock(&xdp->queues_lock); + } else { + /* find a null slot */ + mt_pthread_mutex_lock(&xdp->queues_lock); + for (uint16_t i = 0; i < xdp->queues_cnt; i++) { + if (!xdp->queues_info[i].tx_entry) { + xq = &xdp->queues_info[i]; + xq->tx_entry = entry; + break; + } + } + mt_pthread_mutex_unlock(&xdp->queues_lock); + if (!xq) { + err("%s(%d), no free tx queue\n", __func__, port); + mt_tx_xdp_put(entry); + return NULL; } } - mt_pthread_mutex_unlock(&xdp->queues_lock); - if (!xq) { - err("%s(%d), no free tx queue\n", __func__, port); - mt_tx_xdp_put(entry); - return NULL; - } + entry->xq = xq; entry->queue_id = xq->q; @@ -760,12 +779,15 @@ uint16_t mt_tx_xdp_burst(struct mt_tx_xdp_entry* entry, struct rte_mbuf** tx_pkt } struct mt_rx_xdp_entry* mt_rx_xdp_get(struct mtl_main_impl* impl, enum mtl_port port, - struct mt_rxq_flow* flow) { + struct mt_rxq_flow* flow, + struct mt_rx_xdp_get_args* args) { if (!mt_pmd_is_native_af_xdp(impl, port)) { err("%s(%d), this pmd is not native xdp\n", __func__, port); return NULL; } + MTL_MAY_UNUSED(args); + struct mt_rx_xdp_entry* entry = mt_rte_zmalloc_socket(sizeof(*entry), mt_socket_id(impl, port)); if (!entry) { @@ -778,31 +800,50 @@ struct mt_rx_xdp_entry* mt_rx_xdp_get(struct mtl_main_impl* impl, enum mtl_port struct mt_xdp_priv* xdp = mt_if(impl, port)->xdp; struct mt_xdp_queue* xq = NULL; - /* find a null slot */ - mt_pthread_mutex_lock(&xdp->queues_lock); - for (uint16_t i = 0; i < xdp->queues_cnt; i++) { - if (!xdp->queues_info[i].rx_entry) { - xq = &xdp->queues_info[i]; - xq->rx_entry = entry; - break; + + if (args && args->queue_match) { + mt_pthread_mutex_lock(&xdp->queues_lock); + xq = &xdp->queues_info[args->queue_id]; + if (xq->rx_entry) { + err("%s(%d), q %u is already used\n", __func__, port, args->queue_id); + mt_pthread_mutex_unlock(&xdp->queues_lock); + mt_rx_xdp_put(entry); + return NULL; + } + xq->rx_entry = entry; + mt_pthread_mutex_unlock(&xdp->queues_lock); + } else { + /* find a null slot */ + mt_pthread_mutex_lock(&xdp->queues_lock); + for (uint16_t i = 0; i < xdp->queues_cnt; i++) { + if (!xdp->queues_info[i].rx_entry) { + xq = &xdp->queues_info[i]; + xq->rx_entry = entry; + break; + } + } + mt_pthread_mutex_unlock(&xdp->queues_lock); + if (!xq) { + err("%s(%d), no free rx queue\n", __func__, port); + mt_rx_xdp_put(entry); + return NULL; } } - mt_pthread_mutex_unlock(&xdp->queues_lock); - if (!xq) { - err("%s(%d), no free tx queue\n", __func__, port); - mt_rx_xdp_put(entry); - return NULL; - } + entry->xq = xq; entry->queue_id = xq->q; + entry->skip_udp_port_check = args ? args->skip_udp_port_check : false; uint16_t q = entry->queue_id; - /* create flow */ - entry->flow_rsp = mt_rx_flow_create(impl, port, q - xdp->start_queue, flow); - if (!entry->flow_rsp) { - err("%s(%d,%u), create flow fail\n", __func__, port, q); - mt_rx_xdp_put(entry); - return NULL; + + if (!args || !args->skip_flow) { + /* create flow */ + entry->flow_rsp = mt_rx_flow_create(impl, port, q - xdp->start_queue, flow); + if (!entry->flow_rsp) { + err("%s(%d,%u), create flow fail\n", __func__, port, q); + mt_rx_xdp_put(entry); + return NULL; + } } uint8_t* ip = flow->dip_addr; diff --git a/lib/src/dev/mt_af_xdp.h b/lib/src/dev/mt_af_xdp.h index a14c9fc89..914217d42 100644 --- a/lib/src/dev/mt_af_xdp.h +++ b/lib/src/dev/mt_af_xdp.h @@ -7,19 +7,33 @@ #include "../mt_main.h" +struct mt_tx_xdp_get_args { + bool queue_match; + uint16_t queue_id; +}; + +struct mt_rx_xdp_get_args { + bool queue_match; + uint16_t queue_id; + bool skip_flow; + bool skip_udp_port_check; /* for shared queue or rss queue */ +}; + #ifdef MTL_HAS_XDP_BACKEND int mt_dev_xdp_init(struct mt_interface* inf); int mt_dev_xdp_uinit(struct mt_interface* inf); struct mt_tx_xdp_entry* mt_tx_xdp_get(struct mtl_main_impl* impl, enum mtl_port port, - struct mt_txq_flow* flow); + struct mt_txq_flow* flow, + struct mt_tx_xdp_get_args* args); int mt_tx_xdp_put(struct mt_tx_xdp_entry* entry); uint16_t mt_tx_xdp_burst(struct mt_tx_xdp_entry* entry, struct rte_mbuf** tx_pkts, uint16_t nb_pkts); struct mt_rx_xdp_entry* mt_rx_xdp_get(struct mtl_main_impl* impl, enum mtl_port port, - struct mt_rxq_flow* flow); + struct mt_rxq_flow* flow, + struct mt_rx_xdp_get_args* args); int mt_rx_xdp_put(struct mt_rx_xdp_entry* entry); uint16_t mt_rx_xdp_burst(struct mt_rx_xdp_entry* entry, struct rte_mbuf** rx_pkts, const uint16_t nb_pkts); @@ -39,10 +53,12 @@ static inline int mt_dev_xdp_uinit(struct mt_interface* inf) { static inline struct mt_tx_xdp_entry* mt_tx_xdp_get(struct mtl_main_impl* impl, enum mtl_port port, - struct mt_txq_flow* flow) { + struct mt_txq_flow* flow, + struct mt_tx_xdp_get_args* args) { MTL_MAY_UNUSED(impl); MTL_MAY_UNUSED(port); MTL_MAY_UNUSED(flow); + MTL_MAY_UNUSED(args); return NULL; } @@ -61,10 +77,12 @@ static inline uint16_t mt_tx_xdp_burst(struct mt_tx_xdp_entry* entry, static inline struct mt_rx_xdp_entry* mt_rx_xdp_get(struct mtl_main_impl* impl, enum mtl_port port, - struct mt_rxq_flow* flow) { + struct mt_rxq_flow* flow, + struct mt_rx_xdp_get_args* args) { MTL_MAY_UNUSED(impl); MTL_MAY_UNUSED(port); MTL_MAY_UNUSED(flow); + MTL_MAY_UNUSED(args); return NULL; } diff --git a/lib/src/mt_main.h b/lib/src/mt_main.h index c9d2d719d..44f4d81a0 100644 --- a/lib/src/mt_main.h +++ b/lib/src/mt_main.h @@ -827,6 +827,12 @@ struct mt_stat_mgr { rte_atomic32_t stat_stop; }; +enum mt_sq_mode { + MT_SQ_MODE_DPDK = 0, + MT_SQ_MODE_XDP, + MT_SQ_MODE_MAX, +}; + struct mt_rsq_impl; /* forward delcare */ struct mt_rsq_entry { @@ -847,6 +853,8 @@ MT_TAILQ_HEAD(mt_rsq_entrys_list, mt_rsq_entry); struct mt_rsq_queue { uint16_t port_id; uint16_t queue_id; + /* for native xdp based shared queue */ + struct mt_rx_xdp_entry* xdp; /* List of rsq entry */ struct mt_rsq_entrys_list head; rte_spinlock_t mutex; @@ -864,6 +872,7 @@ struct mt_rsq_impl { /* sq rx queue resources */ uint16_t nb_rsq_queues; struct mt_rsq_queue* rsq_queues; + enum mt_sq_mode queue_mode; }; /* used for sys queue */ @@ -902,6 +911,9 @@ struct mt_tsq_queue { uint16_t queue_id; /* shared tx mempool */ struct rte_mempool* tx_pool; + /* for native xdp based shared queue */ + struct mt_tx_xdp_entry* xdp; + /* List of rsq entry */ struct mt_tsq_entrys_list head; pthread_mutex_t mutex; @@ -918,6 +930,7 @@ struct mt_tsq_impl { /* sq tx queue resources */ uint16_t nb_tsq_queues; struct mt_tsq_queue* tsq_queues; + enum mt_sq_mode queue_mode; }; struct mt_srss_entry { @@ -1021,6 +1034,7 @@ struct mt_rx_xdp_entry { uint16_t queue_id; struct mt_xdp_queue* xq; struct mt_rx_flow_rsp* flow_rsp; + bool skip_udp_port_check; }; struct mt_flow_impl { diff --git a/tests/script/native_af_xdp_json/loop.json b/tests/script/native_af_xdp_json/loop.json index 32d8d90b9..941c8d3bc 100644 --- a/tests/script/native_af_xdp_json/loop.json +++ b/tests/script/native_af_xdp_json/loop.json @@ -1,10 +1,10 @@ { "interfaces": [ { - "name": "native_af_xdp:enp175s0f0np0", + "name": "native_af_xdp:enp0s3np0", }, { - "name": "native_af_xdp:enp175s0f1np1", + "name": "native_af_xdp:enp0s4np0", } ], "tx_sessions": [ diff --git a/tests/script/native_af_xdp_json/loop_4k.json b/tests/script/native_af_xdp_json/loop_4k.json index c395b403a..c0199c01a 100644 --- a/tests/script/native_af_xdp_json/loop_4k.json +++ b/tests/script/native_af_xdp_json/loop_4k.json @@ -1,10 +1,10 @@ { "interfaces": [ { - "name": "native_af_xdp:enp175s0f0np0", + "name": "native_af_xdp:enp0s3np0", }, { - "name": "native_af_xdp:enp175s0f1np1", + "name": "native_af_xdp:enp0s4np0", } ], "tx_sessions": [ diff --git a/tests/script/native_af_xdp_json/loop_rtp.json b/tests/script/native_af_xdp_json/loop_rtp.json index 07fed0357..f767ac527 100644 --- a/tests/script/native_af_xdp_json/loop_rtp.json +++ b/tests/script/native_af_xdp_json/loop_rtp.json @@ -1,10 +1,10 @@ { "interfaces": [ { - "name": "native_af_xdp:enp175s0f0np0", + "name": "native_af_xdp:enp0s3np0", }, { - "name": "native_af_xdp:enp175s0f1np1", + "name": "native_af_xdp:enp0s4np0", } ], "tx_sessions": [ diff --git a/tests/script/native_af_xdp_json/loop_shared.json b/tests/script/native_af_xdp_json/loop_shared.json new file mode 100644 index 000000000..81d030413 --- /dev/null +++ b/tests/script/native_af_xdp_json/loop_shared.json @@ -0,0 +1,107 @@ +{ + "shared_tx_queues": "1", + "shared_rx_queues": "1", + "rss_mode": "none", + "interfaces": [ + { + "name": "native_af_xdp:enp0s3np0", + "tx_queues_cnt": "2", + "rx_queues_cnt": "2", + }, + { + "name": "native_af_xdp:enp0s4np0", + "tx_queues_cnt": "2", + "rx_queues_cnt": "2", + } + ], + "tx_sessions": [ + { + "dip": [ + "local:1" + ], + "interface": [ + 0 + ], + "video": [ + { + "replicas": 2, + "type": "frame", + "pacing": "gap", + "start_port": 20000, + "payload_type": 112, + "tr_offset": "default", + "video_format": "i1080i50", + "pg_format": "YUV_422_10bit", + "video_url": "./test.yuv" + } + ], + "audio": [ + { + "replicas": 2, + "type": "frame", + "start_port": 30000, + "payload_type": 111, + "audio_format": "PCM16", + "audio_channel": ["ST"], + "audio_sampling": "48kHz", + "audio_ptime": "1", + "audio_url": "./test.wav" + } + ], + "ancillary": [ + { + "replicas": 2, + "start_port": 40000, + "payload_type": 113, + "type": "frame", + "ancillary_format": "closed_caption", + "ancillary_url": "./test.txt", + "ancillary_fps": "p59" + } + ] + } + ], + "rx_sessions": [ + { + "ip": [ + "local:0", + ], + "interface": [ + 1 + ], + "video": [ + { + "replicas": 2, + "type": "frame", + "pacing": "gap", + "start_port": 20000, + "payload_type": 112, + "tr_offset": "default", + "video_format": "i1080i50", + "pg_format": "YUV_422_10bit", + "display": false + } + ], + "audio": [ + { + "replicas": 2, + "type": "frame", + "start_port": 30000, + "payload_type": 111, + "audio_format": "PCM16", + "audio_channel": ["ST"], + "audio_sampling": "48kHz", + "audio_ptime": "1", + "audio_url": "./test.wav" + } + ], + "ancillary": [ + { + "replicas": 2, + "payload_type": 113, + "start_port": 40000 + } + ] + } + ] +} diff --git a/tests/script/native_af_xdp_json/mcast.json b/tests/script/native_af_xdp_json/mcast.json index 54eb88062..e4a0c9c07 100644 --- a/tests/script/native_af_xdp_json/mcast.json +++ b/tests/script/native_af_xdp_json/mcast.json @@ -1,10 +1,10 @@ { "interfaces": [ { - "name": "native_af_xdp:enp175s0f0np0", + "name": "native_af_xdp:enp0s3np0", }, { - "name": "native_af_xdp:enp175s0f1np1", + "name": "native_af_xdp:enp0s4np0", } ], "tx_sessions": [ diff --git a/tests/script/native_af_xdp_json/redundant.json b/tests/script/native_af_xdp_json/redundant.json index 9df17e0c8..5245e5435 100644 --- a/tests/script/native_af_xdp_json/redundant.json +++ b/tests/script/native_af_xdp_json/redundant.json @@ -1,10 +1,10 @@ { "interfaces": [ { - "name": "dpdk_af_xdp:enp175s0f0np0", + "name": "dpdk_af_xdp:enp0s3np0", }, { - "name": "dpdk_af_xdp:enp175s0f1np1", + "name": "dpdk_af_xdp:enp0s4np0", } ], "tx_sessions": [ diff --git a/tests/script/native_af_xdp_json/redundant_rtp.json b/tests/script/native_af_xdp_json/redundant_rtp.json index 1814e4c43..3873a3404 100644 --- a/tests/script/native_af_xdp_json/redundant_rtp.json +++ b/tests/script/native_af_xdp_json/redundant_rtp.json @@ -1,10 +1,10 @@ { "interfaces": [ { - "name": "dpdk_af_xdp:enp175s0f0np0", + "name": "dpdk_af_xdp:enp0s3np0", }, { - "name": "dpdk_af_xdp:enp175s0f1np1", + "name": "dpdk_af_xdp:enp0s4np0", } ], "tx_sessions": [ diff --git a/tests/script/native_af_xdp_json/st22p.json b/tests/script/native_af_xdp_json/st22p.json index e8b48c6f0..208bf7df0 100644 --- a/tests/script/native_af_xdp_json/st22p.json +++ b/tests/script/native_af_xdp_json/st22p.json @@ -1,10 +1,10 @@ { "interfaces": [ { - "name": "native_af_xdp:enp175s0f0np0", + "name": "native_af_xdp:enp0s3np0", }, { - "name": "native_af_xdp:enp175s0f1np1", + "name": "native_af_xdp:enp0s4np0", } ], "tx_sessions": [ diff --git a/tests/script/native_af_xdp_json/st22p_redundant.json b/tests/script/native_af_xdp_json/st22p_redundant.json index 7a4c30984..3f7b44dd6 100644 --- a/tests/script/native_af_xdp_json/st22p_redundant.json +++ b/tests/script/native_af_xdp_json/st22p_redundant.json @@ -1,10 +1,10 @@ { "interfaces": [ { - "name": "native_af_xdp:enp175s0f0np0", + "name": "native_af_xdp:enp0s3np0", }, { - "name": "native_af_xdp:enp175s0f1np1", + "name": "native_af_xdp:enp0s4np0", } ], "tx_sessions": [