examples/l2fwd: disable packet type parsing

Disable packet type parsing as l2fwd doesn't rely on packet types.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
This commit is contained in:
Pavan Nikhilesh 2019-11-11 18:49:11 +05:30 committed by Ferruh Yigit
parent 4c634d7392
commit 9731df2e75
3 changed files with 9 additions and 0 deletions

View File

@ -51,6 +51,8 @@ include $(RTE_SDK)/mk/rte.vars.mk
CFLAGS += -O3 CFLAGS += -O3
CFLAGS += $(WERROR_FLAGS) CFLAGS += $(WERROR_FLAGS)
# Add flag to allow experimental API as l2fwd uses rte_ethdev_set_ptype API
CFLAGS += -DALLOW_EXPERIMENTAL_API
include $(RTE_SDK)/mk/rte.extapp.mk include $(RTE_SDK)/mk/rte.extapp.mk
endif endif

View File

@ -713,6 +713,11 @@ main(int argc, char **argv)
"Cannot set error callback for tx buffer on port %u\n", "Cannot set error callback for tx buffer on port %u\n",
portid); portid);
ret = rte_eth_dev_set_ptypes(portid, RTE_PTYPE_UNKNOWN, NULL,
0);
if (ret < 0)
printf("Port %u, Failed to disable Ptype parsing\n",
portid);
/* Start device */ /* Start device */
ret = rte_eth_dev_start(portid); ret = rte_eth_dev_start(portid);
if (ret < 0) if (ret < 0)

View File

@ -6,6 +6,8 @@
# To build this example as a standalone application with an already-installed # To build this example as a standalone application with an already-installed
# DPDK instance, use 'make' # DPDK instance, use 'make'
# Enable experimental API flag as l2fwd uses rte_ethdev_set_ptype API
allow_experimental_apis = true
sources = files( sources = files(
'main.c' 'main.c'
) )