examples/l3fwd: fix using packet type blindly
authorJianfeng Tan <jianfeng.tan@intel.com>
Fri, 25 Mar 2016 00:47:46 +0000 (08:47 +0800)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Fri, 25 Mar 2016 18:53:00 +0000 (19:53 +0100)
commit71a7e2424e07e458ef0e31536ea23890702efd3c
treeead7992cfe42a1ef791126fe1c73b23f4d8d2169
parenta6b450805ba18ae5768dd6f303843f8b6807e97d
examples/l3fwd: fix using packet type blindly

As a example to use ptype info, l3fwd needs firstly to use
rte_eth_dev_get_supported_ptypes() API to check if device and/or
its PMD driver will parse and fill the needed packet type; if not,
use the newly added option, --parse-ptype, to analyze it in the
callback softly.

As the mode of EXACT_MATCH uses the 5 tuples to caculate hash, so
we narrow down its scope to:
  a. ip packets with no extensions, and
  b. L4 payload should be either tcp or udp.

Note: this patch does not completely solve the issue, "cannot run
l3fwd on virtio or other devices", because hw_ip_checksum may be
not supported by the devices. Currently we can:
  a. remove this requirements, or
  b. wait for virtio front end (pmd) to support it.

Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
doc/guides/rel_notes/release_16_04.rst
doc/guides/sample_app_ug/l3_forward.rst
examples/l3fwd/l3fwd.h
examples/l3fwd/l3fwd_em.c
examples/l3fwd/l3fwd_em.h
examples/l3fwd/l3fwd_em_hlm_sse.h
examples/l3fwd/l3fwd_em_sse.h
examples/l3fwd/l3fwd_lpm.c
examples/l3fwd/main.c