Merge "Fix latency accuracy and dumping latencies to file"
[samplevnf.git] / VNFs / DPPD-PROX / handle_nop.c
1 /*
2 // Copyright (c) 2010-2017 Intel Corporation
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 //     http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 */
16
17 #include "handle_nop.h"
18 #include "thread_nop.h"
19
20 static struct task_init task_init_nop_thrpt_opt = {
21         .mode_str = "nop",
22         .init = NULL,
23         .handle = handle_nop_bulk,
24         .thread_x = thread_nop,
25         .flag_features = TASK_FEATURE_NEVER_DISCARDS|TASK_FEATURE_TXQ_FLAGS_NOOFFLOADS|TASK_FEATURE_TXQ_FLAGS_NOMULTSEGS|TASK_FEATURE_THROUGHPUT_OPT|TASK_FEATURE_MULTI_RX,
26         .size = sizeof(struct task_nop),
27         .mbuf_size = 2048 + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM,
28 };
29
30 static struct task_init task_init_nop_lat_opt = {
31         .mode_str = "nop",
32         .sub_mode_str = "latency optimized",
33         .init = NULL,
34         .handle = handle_nop_bulk,
35         .thread_x = thread_nop,
36         .flag_features = TASK_FEATURE_NEVER_DISCARDS|TASK_FEATURE_TXQ_FLAGS_NOOFFLOADS|TASK_FEATURE_TXQ_FLAGS_NOMULTSEGS|TASK_FEATURE_MULTI_RX,
37         .size = sizeof(struct task_nop),
38         .mbuf_size = 2048 + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM,
39 };
40
41 static struct task_init task_init_none;
42
43 __attribute__((constructor)) static void reg_task_nop(void)
44 {
45         reg_task(&task_init_nop_thrpt_opt);
46         reg_task(&task_init_nop_lat_opt);
47
48         /* For backwards compatibility, add none */
49         task_init_none = task_init_nop_thrpt_opt;
50         strcpy(task_init_none.mode_str, "none");
51
52         reg_task(&task_init_none);
53 }