Increase default mbuf size and code simplification/cleanup
[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_THROUGHPUT_OPT|TASK_FEATURE_MULTI_RX,
26         .size = sizeof(struct task_nop),
27 };
28
29 static struct task_init task_init_nop_lat_opt = {
30         .mode_str = "nop",
31         .sub_mode_str = "latency optimized",
32         .init = NULL,
33         .handle = handle_nop_bulk,
34         .thread_x = thread_nop,
35         .flag_features = TASK_FEATURE_NEVER_DISCARDS|TASK_FEATURE_TXQ_FLAGS_NOOFFLOADS|TASK_FEATURE_MULTI_RX,
36         .size = sizeof(struct task_nop),
37 };
38
39 static struct task_init task_init_none;
40
41 __attribute__((constructor)) static void reg_task_nop(void)
42 {
43         reg_task(&task_init_nop_thrpt_opt);
44         reg_task(&task_init_nop_lat_opt);
45
46         /* For backwards compatibility, add none */
47         task_init_none = task_init_nop_thrpt_opt;
48         strcpy(task_init_none.mode_str, "none");
49
50         reg_task(&task_init_none);
51 }