summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsongyanchao <[email protected]>2024-04-22 13:25:02 +0000
committersongyanchao <[email protected]>2024-04-22 13:25:02 +0000
commit78856a637644577eb0464e06d31595a24611c082 (patch)
tree339cb086c236e15dc7b212ac530e7c36b7e93c72
parent3d294e63dc5a2cad32795145e5b1086b4a126789 (diff)
🐞 fix: Fix forgotten offset issue after obj usage.v4.7.4-20240422
Fix forgotten offset issue after obj usage.
-rw-r--r--service/src/node_phydev.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/service/src/node_phydev.c b/service/src/node_phydev.c
index 2886431..849f770 100644
--- a/service/src/node_phydev.c
+++ b/service/src/node_phydev.c
@@ -594,6 +594,7 @@ static __rte_always_inline uint16_t dpdk_dev_tx_node_process(struct rte_graph *
#endif
uint16_t n_left_from = cnt;
+ struct rte_mbuf ** pkts = (struct rte_mbuf **)objs;
while (n_left_from > 0)
{
@@ -617,7 +618,7 @@ static __rte_always_inline uint16_t dpdk_dev_tx_node_process(struct rte_graph *
struct rte_meter_srtcm_profile * profile = dpdk_dev_desc->tx_meter_profile[graph->id];
for (unsigned int i = 0; i < nr_curr_send; i++)
{
- struct rte_mbuf * mbuf = (struct rte_mbuf *)objs[i];
+ struct rte_mbuf * mbuf = (struct rte_mbuf *)pkts[i];
uint64_t tsc = rte_get_timer_cycles();
enum rte_color color = rte_meter_srtcm_color_blind_check(meter, profile, tsc, mbuf->pkt_len);
@@ -647,7 +648,7 @@ static __rte_always_inline uint16_t dpdk_dev_tx_node_process(struct rte_graph *
}
else
{
- rte_memcpy(mbufs_to_send, objs, nr_curr_send * sizeof(void *));
+ rte_memcpy(mbufs_to_send, pkts, nr_curr_send * sizeof(void *));
nr_mbufs_to_send = nr_curr_send;
}
@@ -665,6 +666,7 @@ static __rte_always_inline uint16_t dpdk_dev_tx_node_process(struct rte_graph *
stat_per_core->tx_meter_green += counter_tx_meter_green;
stat_per_core->total_tx_pkts += nr_mbufs_to_send;
stat_per_core->total_tx_drop_pkts += nr_mbufs_to_drop;
+ pkts += nr_curr_send;
}
return cnt;