[v16,7/8] examples/l2fwd: disable ptype parsing

Message ID 20191106191803.15098-8-pbhagavatula@marvell.com (mailing list archive)
State Superseded, archived
Delegated to: Ferruh Yigit
Headers
Series ethdev: add new Rx offload flags |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail Compilation issues

Commit Message

Pavan Nikhilesh Bhagavatula Nov. 6, 2019, 7:18 p.m. UTC
  From: Pavan Nikhilesh <pbhagavatula@marvell.com>

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

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 examples/l2fwd/Makefile    | 1 +
 examples/l2fwd/main.c      | 2 ++
 examples/l2fwd/meson.build | 1 +
 3 files changed, 4 insertions(+)
  

Comments

Ferruh Yigit Nov. 7, 2019, 5:59 p.m. UTC | #1
On 11/6/2019 7:18 PM, pbhagavatula@marvell.com wrote:
> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
> 
> Disable packet type parsing as l2fwd doesn't rely on packet types.
> 
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
> ---
>  examples/l2fwd/Makefile    | 1 +
>  examples/l2fwd/main.c      | 2 ++
>  examples/l2fwd/meson.build | 1 +
>  3 files changed, 4 insertions(+)
> 
> diff --git a/examples/l2fwd/Makefile b/examples/l2fwd/Makefile
> index 230352093..123e6161c 100644
> --- a/examples/l2fwd/Makefile
> +++ b/examples/l2fwd/Makefile
> @@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
>  
>  CFLAGS += -O3
>  CFLAGS += $(WERROR_FLAGS)
> +CFLAGS += -DALLOW_EXPERIMENTAL_API
>  
>  include $(RTE_SDK)/mk/rte.extapp.mk
>  endif
> diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c
> index d7bcbfae7..3e7ad3ef1 100644
> --- a/examples/l2fwd/main.c
> +++ b/examples/l2fwd/main.c
> @@ -713,6 +713,8 @@ main(int argc, char **argv)
>  			"Cannot set error callback for tx buffer on port %u\n",
>  				 portid);
>  
> +		rte_eth_dev_set_ptypes(portid, RTE_PTYPE_UNKNOWN,
> +						 NULL, 0);

Should we use the return value, and print a log perhaps, my concern is static
analysis tools will complain about unchecked return value.

And to prevent the noise, don't log on -ENOTSUP error, wdyt?
  
Ferruh Yigit Nov. 7, 2019, 6:30 p.m. UTC | #2
On 11/6/2019 7:18 PM, pbhagavatula@marvell.com wrote:
> diff --git a/examples/l2fwd/Makefile b/examples/l2fwd/Makefile
> index 230352093..123e6161c 100644
> --- a/examples/l2fwd/Makefile
> +++ b/examples/l2fwd/Makefile
> @@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
>  
>  CFLAGS += -O3
>  CFLAGS += $(WERROR_FLAGS)
> +CFLAGS += -DALLOW_EXPERIMENTAL_API

Can you please add the experimental API as comment, it may help removing these
flags when APIs becomes non-experimental.

Some thing for meson.
  

Patch

diff --git a/examples/l2fwd/Makefile b/examples/l2fwd/Makefile
index 230352093..123e6161c 100644
--- a/examples/l2fwd/Makefile
+++ b/examples/l2fwd/Makefile
@@ -51,6 +51,7 @@  include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 endif
diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c
index d7bcbfae7..3e7ad3ef1 100644
--- a/examples/l2fwd/main.c
+++ b/examples/l2fwd/main.c
@@ -713,6 +713,8 @@  main(int argc, char **argv)
 			"Cannot set error callback for tx buffer on port %u\n",
 				 portid);
 
+		rte_eth_dev_set_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/l2fwd/meson.build b/examples/l2fwd/meson.build
index c34e11e36..2b0a25036 100644
--- a/examples/l2fwd/meson.build
+++ b/examples/l2fwd/meson.build
@@ -6,6 +6,7 @@ 
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )