Skip to content

Commit 57d7b19

Browse files
SakoramDawidWesierski4
authored andcommitted
Add: Support for DPDK 25.11
1 parent 8470fa4 commit 57d7b19

13 files changed

+606
-11
lines changed

lib/src/dev/mt_dev.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -802,7 +802,7 @@ static int dev_detect_link(struct mt_interface* inf) {
802802

803803
memset(&eth_link, 0, sizeof(eth_link));
804804

805-
for (int i = 0; i < 100; i++) {
805+
for (int i = 0; i < 300; i++) {
806806
err = rte_eth_link_get_nowait(port_id, &eth_link);
807807
if (err < 0) {
808808
err("%s, failed to get link status for port %d, ret %d\n", __func__, port_id, err);
@@ -814,7 +814,7 @@ static int dev_detect_link(struct mt_interface* inf) {
814814
mt_eth_link_dump(port_id);
815815
return 0;
816816
}
817-
mt_sleep_ms(100); /* only happen on CVL PF */
817+
mt_sleep_ms(100); /* only happen on CVL PF and CNV PF */
818818
}
819819

820820
mt_eth_link_dump(port_id);

lib/src/mt_main.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include <math.h>
88
#include <rte_alarm.h>
99
#include <rte_arp.h>
10+
#include <rte_cpuflags.h>
1011
#include <rte_errno.h>
1112
#include <rte_ethdev.h>
1213
#include <rte_thash.h>
@@ -961,7 +962,7 @@ struct mt_rsq_impl {
961962
/* if launch time enabled */
962963
#define MT_TXQ_FLOW_F_LAUNCH_TIME (MTL_BIT32(1))
963964
/* force to use socket, only for MT_DRV_F_KERNEL_BASED */
964-
#define MT_TXQ_FLOW_F_FORCE_SOCKET (MTL_BIT32(1))
965+
#define MT_TXQ_FLOW_F_FORCE_SOCKET (MTL_BIT32(2))
965966

966967
/* request of tx queue flow */
967968
struct mt_txq_flow {

lib/src/mt_pcap.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,16 @@ struct mt_pcap* mt_pcap_open(struct mtl_main_impl* impl, enum mtl_port port, int
4949
mt_pcap_close(pcap);
5050
return NULL;
5151
}
52-
#if RTE_VERSION >= RTE_VERSION_NUM(23, 3, 0, 0)
52+
53+
#if RTE_VERSION >= RTE_VERSION_NUM(25, 11, 0, 0)
54+
for (int i = 0; i < mt_num_ports(impl); i++) {
55+
ret = rte_pcapng_add_interface(pcap->pcapng, mt_port_id(impl, i), DLT_EN10MB, NULL,
56+
NULL, NULL);
57+
if (ret < 0) {
58+
warn("%s(%d), add interface fail %d on port %d\n", __func__, fd, ret, i);
59+
}
60+
}
61+
#elif RTE_VERSION >= RTE_VERSION_NUM(23, 3, 0, 0)
5362
/* add all port interfaces */
5463
for (int i = 0; i < mt_num_ports(impl); i++) {
5564
ret = rte_pcapng_add_interface(pcap->pcapng, mt_port_id(impl, i), NULL, NULL, NULL);

lib/src/mt_ptp.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -871,10 +871,6 @@ static void ptp_delay_req_task(struct mt_ptp_impl* ptp) {
871871
m->pkt_len = hdr_offset + sizeof(struct mt_ptp_sync_msg);
872872
m->data_len = m->pkt_len;
873873

874-
#if MT_PTP_USE_TX_TIME_STAMP
875-
ptp_timesync_read_tx_time(ptp, &tx_ns); /* read out tx time */
876-
#endif
877-
878874
// mt_mbuf_dump(port, 0, "PTP_DELAY_REQ", m);
879875
uint16_t tx = mt_sys_queue_tx_burst(ptp->impl, port, &m, 1);
880876
if (tx < 1) {

lib/src/st2110/st_tx_video_session.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@ static int tv_sync_pacing(struct mtl_main_impl* impl, struct st_tx_video_session
639639
uint64_t cur_tai = mt_get_ptp_time(impl, MTL_PORT_P);
640640
uint64_t cur_tsc = mt_get_tsc(impl);
641641
uint64_t start_time_tai;
642-
uint64_t time_to_tx_ns;
642+
int64_t time_to_tx_ns;
643643

644644
pacing->cur_epochs = calc_frame_count_since_epoch(s, cur_tai, required_tai);
645645

@@ -651,8 +651,8 @@ static int tv_sync_pacing(struct mtl_main_impl* impl, struct st_tx_video_session
651651
time_to_tx_ns = start_time_tai - cur_tai;
652652

653653
if (time_to_tx_ns < 0) {
654-
/* should never happen */
655-
err("%s(%d), negative time_to_tx_ns detected: %ld ns. Current PTP time: %" PRIu64
654+
/* should never happen, but it does. TODO: check why */
655+
dbg("%s(%d), negative time_to_tx_ns detected: %ld ns. Current PTP time: %" PRIu64
656656
"\n",
657657
__func__, s->idx, time_to_tx_ns, cur_tai);
658658
time_to_tx_ns = 0;
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
From c4e622441564203a6e8b8586dcab520286d04236 Mon Sep 17 00:00:00 2001
2+
From: "Kasiewicz, Marek" <[email protected]>
3+
Date: Mon, 31 Mar 2025 11:42:58 +0000
4+
Subject: [PATCH 1/6] e810: set max ring desc to max allowed by hardware
5+
6+
Signed-off-by: Kasiewicz, Marek <[email protected]>
7+
---
8+
drivers/net/intel/iavf/iavf_rxtx.h | 2 +-
9+
1 file changed, 1 insertion(+), 1 deletion(-)
10+
11+
diff --git a/drivers/net/intel/iavf/iavf_rxtx.h b/drivers/net/intel/iavf/iavf_rxtx.h
12+
index 1641bfe59a..9502321be0 100644
13+
--- a/drivers/net/intel/iavf/iavf_rxtx.h
14+
+++ b/drivers/net/intel/iavf/iavf_rxtx.h
15+
@@ -16,7 +16,7 @@
16+
/* In QLEN must be whole number of 32 descriptors. */
17+
#define IAVF_ALIGN_RING_DESC 32
18+
#define IAVF_MIN_RING_DESC 64
19+
-#define IAVF_MAX_RING_DESC 4096
20+
+#define IAVF_MAX_RING_DESC (8192 - 32)
21+
#define IAVF_DMA_MEM_ALIGN 4096
22+
/* Base address of the HW descriptor ring should be 128B aligned. */
23+
#define IAVF_RING_BASE_ALIGN 128
24+
--
25+
2.34.1
26+
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
From 33d0f922f2bed99cdab07fa8b6f60b4150845139 Mon Sep 17 00:00:00 2001
2+
From: Ting Xu <[email protected]>
3+
Date: Tue, 19 Apr 2022 02:09:28 +0000
4+
Subject: [PATCH 2/6] net/iavf: refine queue rate limit configure
5+
6+
Refine two operations when configuring queue rate limit:
7+
1. no need to stop port first, now can configure queue rate limit at
8+
runtime
9+
2. users can delete part of the queues and set new rate limit for them,
10+
but they must assign correct queue id. Otherwise, the result will be not
11+
correct.
12+
13+
Signed-off-by: Ting Xu <[email protected]>
14+
---
15+
drivers/net/intel/iavf/iavf_tm.c | 11 +++++++----
16+
1 file changed, 7 insertions(+), 4 deletions(-)
17+
18+
diff --git a/drivers/net/intel/iavf/iavf_tm.c b/drivers/net/intel/iavf/iavf_tm.c
19+
index 1d12196ba6..67186dff67 100644
20+
--- a/drivers/net/intel/iavf/iavf_tm.c
21+
+++ b/drivers/net/intel/iavf/iavf_tm.c
22+
@@ -810,8 +810,10 @@ static int iavf_hierarchy_commit(struct rte_eth_dev *dev,
23+
int index = 0, node_committed = 0;
24+
int i, ret_val = IAVF_SUCCESS;
25+
26+
- /* check if port is stopped */
27+
- if (adapter->stopped != 1) {
28+
+ /* check if port is stopped, except for setting queue bandwidth */
29+
+ if (vf->tm_conf.nb_tc_node != 1 &&
30+
+ vf->qos_cap->num_elem != 1 &&
31+
+ adapter->stopped != 1) {
32+
PMD_DRV_LOG(ERR, "Please stop port first");
33+
ret_val = IAVF_ERR_NOT_READY;
34+
goto err;
35+
@@ -862,7 +864,7 @@ static int iavf_hierarchy_commit(struct rte_eth_dev *dev,
36+
q_tc_mapping->tc[tm_node->tc].req.queue_count++;
37+
38+
if (tm_node->shaper_profile) {
39+
- q_bw->cfg[node_committed].queue_id = node_committed;
40+
+ q_bw->cfg[node_committed].queue_id = tm_node->id;
41+
q_bw->cfg[node_committed].shaper.peak =
42+
tm_node->shaper_profile->profile.peak.rate /
43+
1000 * IAVF_BITS_PER_BYTE;
44+
@@ -906,7 +908,8 @@ static int iavf_hierarchy_commit(struct rte_eth_dev *dev,
45+
goto fail_clear;
46+
47+
vf->qtc_map = qtc_map;
48+
- vf->tm_conf.committed = true;
49+
+ if (adapter->stopped == 1)
50+
+ vf->tm_conf.committed = true;
51+
return ret_val;
52+
53+
fail_clear:
54+
--
55+
2.34.1
56+
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
From 65ee1358c09bd98cd08a16598b1822f820037558 Mon Sep 17 00:00:00 2001
2+
From: Frank Du <[email protected]>
3+
Date: Tue, 21 Feb 2023 09:26:05 +0800
4+
Subject: [PATCH 3/6] ice: set ICE_SCHED_DFLT_BURST_SIZE to 2048
5+
6+
For st2110 rl burst optimization
7+
8+
Signed-off-by: Frank Du <[email protected]>
9+
---
10+
drivers/net/intel/ice/base/ice_type.h | 2 +-
11+
1 file changed, 1 insertion(+), 1 deletion(-)
12+
13+
diff --git a/drivers/net/intel/ice/base/ice_type.h b/drivers/net/intel/ice/base/ice_type.h
14+
index ae3b944d6e..02e98ae988 100644
15+
--- a/drivers/net/intel/ice/base/ice_type.h
16+
+++ b/drivers/net/intel/ice/base/ice_type.h
17+
@@ -1087,7 +1087,7 @@ enum ice_rl_type {
18+
#define ICE_SCHED_NO_SHARED_RL_PROF_ID 0xFFFF
19+
#define ICE_SCHED_DFLT_BW_WT 4
20+
#define ICE_SCHED_INVAL_PROF_ID 0xFFFF
21+
-#define ICE_SCHED_DFLT_BURST_SIZE (15 * 1024) /* in bytes (15k) */
22+
+#define ICE_SCHED_DFLT_BURST_SIZE (2 * 1024) /* in bytes (2k) */
23+
24+
/* Access Macros for Tx Sched RL Profile data */
25+
#define ICE_TXSCHED_GET_RL_PROF_ID(p) LE16_TO_CPU((p)->info.profile_id)
26+
--
27+
2.34.1
28+
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
From 1df44ba751ddd8d9831cfaa123475fc0db172da8 Mon Sep 17 00:00:00 2001
2+
From: "Kasiewicz, Marek" <[email protected]>
3+
Date: Mon, 31 Mar 2025 12:37:40 +0000
4+
Subject: [PATCH 4/6] Change to enable PTP
5+
6+
Signed-off-by: Kasiewicz, Marek <[email protected]>
7+
---
8+
drivers/net/intel/ice/ice_rxtx.c | 9 +++------
9+
1 file changed, 3 insertions(+), 6 deletions(-)
10+
11+
diff --git a/drivers/net/intel/ice/ice_rxtx.c b/drivers/net/intel/ice/ice_rxtx.c
12+
index da508592aa..c832fdd083 100644
13+
--- a/drivers/net/intel/ice/ice_rxtx.c
14+
+++ b/drivers/net/intel/ice/ice_rxtx.c
15+
@@ -1972,8 +1972,7 @@ ice_rx_scan_hw_ring(struct ci_rx_queue *rxq)
16+
pkt_flags |= rxq->ts_flag;
17+
}
18+
19+
- if (ad->ptp_ena && ((mb->packet_type &
20+
- RTE_PTYPE_L2_MASK) == RTE_PTYPE_L2_ETHER_TIMESYNC)) {
21+
+ if (ad->ptp_ena) {
22+
rxq->time_high =
23+
rte_le_to_cpu_32(rxdp[j].wb.flex_ts.ts_high);
24+
mb->timesync = rxq->queue_id;
25+
@@ -2339,8 +2338,7 @@ ice_recv_scattered_pkts(void *rx_queue,
26+
pkt_flags |= rxq->ts_flag;
27+
}
28+
29+
- if (ad->ptp_ena && ((first_seg->packet_type & RTE_PTYPE_L2_MASK)
30+
- == RTE_PTYPE_L2_ETHER_TIMESYNC)) {
31+
+ if (ad->ptp_ena) {
32+
rxq->time_high =
33+
rte_le_to_cpu_32(rxd.wb.flex_ts.ts_high);
34+
first_seg->timesync = rxq->queue_id;
35+
@@ -2837,8 +2835,7 @@ ice_recv_pkts(void *rx_queue,
36+
pkt_flags |= rxq->ts_flag;
37+
}
38+
39+
- if (ad->ptp_ena && ((rxm->packet_type & RTE_PTYPE_L2_MASK) ==
40+
- RTE_PTYPE_L2_ETHER_TIMESYNC)) {
41+
+ if (ad->ptp_ena) {
42+
rxq->time_high =
43+
rte_le_to_cpu_32(rxd.wb.flex_ts.ts_high);
44+
rxm->timesync = rxq->queue_id;
45+
--
46+
2.34.1
47+
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
From e3f5f1819f22b92d055c6d18e20aa7656c46a364 Mon Sep 17 00:00:00 2001
2+
From: Ric Li <[email protected]>
3+
Date: Fri, 1 Dec 2023 18:52:34 +0800
4+
Subject: [PATCH 5/6] iavf: disable runtime queue
5+
6+
Signed-off-by: Ric Li <[email protected]>
7+
---
8+
drivers/net/intel/iavf/iavf_ethdev.c | 4 +---
9+
1 file changed, 1 insertion(+), 3 deletions(-)
10+
11+
diff --git a/drivers/net/intel/iavf/iavf_ethdev.c b/drivers/net/intel/iavf/iavf_ethdev.c
12+
index 335a8126c4..10d4ff84f9 100644
13+
--- a/drivers/net/intel/iavf/iavf_ethdev.c
14+
+++ b/drivers/net/intel/iavf/iavf_ethdev.c
15+
@@ -1140,9 +1140,7 @@ iavf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
16+
dev_info->reta_size = vf->vf_res->rss_lut_size;
17+
dev_info->flow_type_rss_offloads = IAVF_RSS_OFFLOAD_ALL;
18+
dev_info->max_mac_addrs = IAVF_NUM_MACADDR_MAX;
19+
- dev_info->dev_capa =
20+
- RTE_ETH_DEV_CAPA_RUNTIME_RX_QUEUE_SETUP |
21+
- RTE_ETH_DEV_CAPA_RUNTIME_TX_QUEUE_SETUP;
22+
+ dev_info->dev_capa &= ~RTE_ETH_DEV_CAPA_FLOW_RULE_KEEP;
23+
dev_info->rx_offload_capa =
24+
RTE_ETH_RX_OFFLOAD_VLAN_STRIP |
25+
RTE_ETH_RX_OFFLOAD_QINQ_STRIP |
26+
--
27+
2.34.1
28+

0 commit comments

Comments
 (0)