2 // Copyright (c) 2010-2017 Intel Corporation
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
8 // http://www.apache.org/licenses/LICENSE-2.0
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.
17 #include "handle_nop.h"
18 #include "thread_nop.h"
20 static struct task_init task_init_nop_thrpt_opt = {
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,
30 static struct task_init task_init_nop_lat_opt = {
32 .sub_mode_str = "latency optimized",
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,
41 static struct task_init task_init_none;
43 __attribute__((constructor)) static void reg_task_nop(void)
45 reg_task(&task_init_nop_thrpt_opt);
46 reg_task(&task_init_nop_lat_opt);
48 /* For backwards compatibility, add none */
49 task_init_none = task_init_nop_thrpt_opt;
50 strcpy(task_init_none.mode_str, "none");
52 reg_task(&task_init_none);