From 56400cedab3a066b10401f676a8ee86c2463ff53 Mon Sep 17 00:00:00 2001 From: Anand B Jyoti Date: Fri, 2 Jun 2017 10:37:48 +0530 Subject: vCGNAPT: correcting to use default rte_ring_dequeue JIRA: SAMPLEVNF-19 The rte_ring_sc_dequeue returns ENOENT in DPDK16.04 while ENOBUFS in DPDK17.05. This leads to error in return value checking and mis behaviour. Using of rte_ring_sc_dequeue() to be avoided to use the default configuration as set during the creation of the queue as per the DPDK API documentation. Similarly corrected for mp_dequeue as well. Change-Id: Iacee1349b26d6ab432be891fad12313a6d68ca4d Signed-off-by: Anand B Jyoti --- VNFs/vCGNAPT/pipeline/pipeline_timer_be.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'VNFs') diff --git a/VNFs/vCGNAPT/pipeline/pipeline_timer_be.c b/VNFs/vCGNAPT/pipeline/pipeline_timer_be.c index bfe8f5c4..7ba4964a 100644 --- a/VNFs/vCGNAPT/pipeline/pipeline_timer_be.c +++ b/VNFs/vCGNAPT/pipeline/pipeline_timer_be.c @@ -113,7 +113,7 @@ void timer_thread_enqueue(struct pipeline_cgnapt_entry_key *egress_key, sizeof(struct cgnapt_table_entry)); } - if (rte_ring_mp_enqueue(timer_ring, (void *)tk_ptr) == -ENOBUFS) + if (rte_ring_enqueue(timer_ring, (void *)tk_ptr) == -ENOBUFS) printf("Ring enqueue failed: trying to enqueue\n"); } @@ -126,7 +126,7 @@ void timer_thread_dequeue(void) struct timer_key *tk_ptr; int ret; - ret = rte_ring_sc_dequeue(timer_ring, (void *)&tk_ptr); + ret = rte_ring_dequeue(timer_ring, (void *)&tk_ptr); if (ret == -ENOENT) return; @@ -444,8 +444,8 @@ static void *pipeline_timer_init(struct pipeline_params *params, void *arg) if (timer_key_mempool == NULL) rte_panic("timer_key_mempool create error\n"); - timer_ring = rte_ring_create("TIMER_RING", - timer_ring_alloc_cnt, rte_socket_id(), 0); + timer_ring = rte_ring_create("TIMER_RING", timer_ring_alloc_cnt, + rte_socket_id(), RING_F_SC_DEQ); if (timer_ring == NULL) rte_panic("timer_ring creation failed"); -- cgit 1.2.3-korg cker/Dockerfile?h=opnfv-5.0.0&id=6458b5ec9ea5bdac5b60f2edde8decefae16422f'>treecommitdiffstats
blob: 62ea0d037c4ac839169e70577e15225ffaaf1279 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60