DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] app/testpmd: support QinQ offload in VLAN set command
@ 2019-09-13 12:15 viveksharma
  2019-09-29  4:28 ` Vivek Kumar Sharma
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: viveksharma @ 2019-09-13 12:15 UTC (permalink / raw)
  To: dev; +Cc: intoviveksharma, ferruh.yigit, Vivek Sharma

From: Vivek Sharma <viveksharma@marvell.com>

Segregate QinQ from Extend Offload and support QinQ offload
in vlan set command. Merge all port wise rx vlan offloads in
command line help and documentation for a cleaner structure.

Signed-off-by: Vivek Sharma <viveksharma@marvell.com>
---
 app/test-pmd/cmdline.c                      | 19 +++++++------------
 app/test-pmd/config.c                       | 27 +++++++++++++++++++++++++++
 app/test-pmd/testpmd.h                      |  1 +
 doc/guides/testpmd_app_ug/testpmd_funcs.rst | 23 ++++-------------------
 4 files changed, 39 insertions(+), 31 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index b6bc34b..479a4f2 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -325,9 +325,6 @@ static void cmd_help_long_parsed(void *parsed_result,
 			"set vf broadcast (port_id) (vf_id) (on|off)\n"
 			"    Set VF broadcast for a VF from the PF.\n\n"
 
-			"vlan set strip (on|off) (port_id)\n"
-			"    Set the VLAN strip on a port.\n\n"
-
 			"vlan set stripq (on|off) (port_id,queue_id)\n"
 			"    Set the VLAN strip for a queue on a port.\n\n"
 
@@ -358,12 +355,8 @@ static void cmd_help_long_parsed(void *parsed_result,
 			"set tc tx min-bandwidth (port_id) (bw1, bw2, ...)\n"
 			"    Set all TCs' min bandwidth(%%) for all PF and VFs.\n\n"
 
-			"vlan set filter (on|off) (port_id)\n"
-			"    Set the VLAN filter on a port.\n\n"
-
-			"vlan set qinq (on|off) (port_id)\n"
-			"    Set the VLAN QinQ (extended queue in queue)"
-			" on a port.\n\n"
+			"vlan set (strip|filter|qinq|extend) (on|off) (port_id)\n"
+			"    Set the VLAN strip or filter or qinq strip or extend\n\n"
 
 			"vlan set (inner|outer) tpid (value) (port_id)\n"
 			"    Set the VLAN TPID for Packet Filtering on"
@@ -3902,6 +3895,8 @@ cmd_vlan_offload_parsed(void *parsed_result,
 	}
 	else if (!strcmp(res->what, "filter"))
 		rx_vlan_filter_set(port_id, on);
+	else if (!strcmp(res->what, "qinq"))
+		rx_vlan_qinq_strip_set(port_id, on);
 	else
 		vlan_extend_set(port_id, on);
 
@@ -3916,7 +3911,7 @@ cmdline_parse_token_string_t cmd_vlan_offload_set =
 				 set, "set");
 cmdline_parse_token_string_t cmd_vlan_offload_what =
 	TOKEN_STRING_INITIALIZER(struct cmd_vlan_offload_result,
-				 what, "strip#filter#qinq#stripq");
+				 what, "strip#filter#qinq#extend#stripq");
 cmdline_parse_token_string_t cmd_vlan_offload_on =
 	TOKEN_STRING_INITIALIZER(struct cmd_vlan_offload_result,
 			      on, "on#off");
@@ -3927,9 +3922,9 @@ cmdline_parse_token_string_t cmd_vlan_offload_portid =
 cmdline_parse_inst_t cmd_vlan_offload = {
 	.f = cmd_vlan_offload_parsed,
 	.data = NULL,
-	.help_str = "vlan set strip|filter|qinq|stripq on|off "
+	.help_str = "vlan set strip|filter|qinq|extend|stripq on|off "
 		"<port_id[,queue_id]>: "
-		"Filter/Strip for rx side qinq(extended) for both rx/tx sides",
+		"Strip/Filter/QinQ for rx side Extend for both rx/tx sides",
 	.tokens = {
 		(void *)&cmd_vlan_offload_vlan,
 		(void *)&cmd_vlan_offload_set,
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 1a5a5c1..372ca54 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -2985,6 +2985,33 @@ rx_vlan_filter_set(portid_t port_id, int on)
 	ports[port_id].dev_conf.rxmode.offloads = port_rx_offloads;
 }
 
+void
+rx_vlan_qinq_strip_set(portid_t port_id, int on)
+{
+	int diag;
+	int vlan_offload;
+	uint64_t port_rx_offloads = ports[port_id].dev_conf.rxmode.offloads;
+
+	if (port_id_is_invalid(port_id, ENABLED_WARN))
+		return;
+
+	vlan_offload = rte_eth_dev_get_vlan_offload(port_id);
+
+	if (on) {
+		vlan_offload |= ETH_QINQ_STRIP_OFFLOAD;
+		port_rx_offloads |= DEV_RX_OFFLOAD_QINQ_STRIP;
+	} else {
+		vlan_offload &= ~ETH_QINQ_STRIP_OFFLOAD;
+		port_rx_offloads &= ~DEV_RX_OFFLOAD_QINQ_STRIP;
+	}
+
+	diag = rte_eth_dev_set_vlan_offload(port_id, vlan_offload);
+	if (diag < 0)
+		printf("%s(port_pi=%d, on=%d) failed "
+	       "diag=%d\n", __func__, port_id, on, diag);
+	ports[port_id].dev_conf.rxmode.offloads = port_rx_offloads;
+}
+
 int
 rx_vft_set(portid_t port_id, uint16_t vlan_id, int on)
 {
diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
index ce13eb8..05c8967 100644
--- a/app/test-pmd/testpmd.h
+++ b/app/test-pmd/testpmd.h
@@ -752,6 +752,7 @@ void rx_vlan_strip_set_on_queue(portid_t port_id, uint16_t queue_id, int on);
 
 void rx_vlan_filter_set(portid_t port_id, int on);
 void rx_vlan_all_filter_set(portid_t port_id, int on);
+void rx_vlan_qinq_strip_set(portid_t port_id, int on);
 int rx_vft_set(portid_t port_id, uint16_t vlan_id, int on);
 void vlan_extend_set(portid_t port_id, int on);
 void vlan_tpid_set(portid_t port_id, enum rte_vlan_type vlan_type,
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index 67f4339..0029865 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -799,13 +799,6 @@ Set broadcast mode for a VF from the PF::
 
    testpmd> set vf broadcast (port_id) (vf_id) (on|off)
 
-vlan set strip
-~~~~~~~~~~~~~~
-
-Set the VLAN strip on a port::
-
-   testpmd> vlan set strip (on|off) (port_id)
-
 vlan set stripq
 ~~~~~~~~~~~~~~~
 
@@ -841,19 +834,11 @@ Set VLAN antispoof for a VF from the PF::
 
    testpmd> set vf vlan antispoof (port_id) (vf_id) (on|off)
 
-vlan set filter
-~~~~~~~~~~~~~~~
-
-Set the VLAN filter on a port::
-
-   testpmd> vlan set filter (on|off) (port_id)
-
-vlan set qinq
-~~~~~~~~~~~~~
-
-Set the VLAN QinQ (extended queue in queue) on for a port::
+vlan set (strip|filter|qinq|extend)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Set the VLAN strip/filter/QinQ strip/extend on for a port::
 
-   testpmd> vlan set qinq (on|off) (port_id)
+   testpmd> vlan set (strip|filter|qinq|extend) (on|off) (port_id)
 
 vlan set tpid
 ~~~~~~~~~~~~~
-- 
2.7.4


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [dpdk-dev] [PATCH] app/testpmd: support QinQ offload in VLAN set command
  2019-09-13 12:15 [dpdk-dev] [PATCH] app/testpmd: support QinQ offload in VLAN set command viveksharma
@ 2019-09-29  4:28 ` Vivek Kumar Sharma
  2019-10-09 12:56 ` Ferruh Yigit
  2019-10-11  4:05 ` [dpdk-dev] [PATCH v2] " viveksharma
  2 siblings, 0 replies; 9+ messages in thread
From: Vivek Kumar Sharma @ 2019-09-29  4:28 UTC (permalink / raw)
  To: dev; +Cc: intoviveksharma, ferruh.yigit

Ping!


Thanks,
Vivek


________________________________________
From: viveksharma@marvell.com <viveksharma@marvell.com>
Sent: 13 September 2019 17:45
To: dev@dpdk.org
Cc: intoviveksharma@gmail.com; ferruh.yigit@intel.com; Vivek Kumar Sharma
Subject: [PATCH] app/testpmd: support QinQ offload in VLAN set command

From: Vivek Sharma <viveksharma@marvell.com>

Segregate QinQ from Extend Offload and support QinQ offload
in vlan set command. Merge all port wise rx vlan offloads in
command line help and documentation for a cleaner structure.

Signed-off-by: Vivek Sharma <viveksharma@marvell.com>
---
 app/test-pmd/cmdline.c                      | 19 +++++++------------
 app/test-pmd/config.c                       | 27 +++++++++++++++++++++++++++
 app/test-pmd/testpmd.h                      |  1 +
 doc/guides/testpmd_app_ug/testpmd_funcs.rst | 23 ++++-------------------
 4 files changed, 39 insertions(+), 31 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index b6bc34b..479a4f2 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -325,9 +325,6 @@ static void cmd_help_long_parsed(void *parsed_result,
                        "set vf broadcast (port_id) (vf_id) (on|off)\n"
                        "    Set VF broadcast for a VF from the PF.\n\n"

-                       "vlan set strip (on|off) (port_id)\n"
-                       "    Set the VLAN strip on a port.\n\n"
-
                        "vlan set stripq (on|off) (port_id,queue_id)\n"
                        "    Set the VLAN strip for a queue on a port.\n\n"

@@ -358,12 +355,8 @@ static void cmd_help_long_parsed(void *parsed_result,
                        "set tc tx min-bandwidth (port_id) (bw1, bw2, ...)\n"
                        "    Set all TCs' min bandwidth(%%) for all PF and VFs.\n\n"

-                       "vlan set filter (on|off) (port_id)\n"
-                       "    Set the VLAN filter on a port.\n\n"
-
-                       "vlan set qinq (on|off) (port_id)\n"
-                       "    Set the VLAN QinQ (extended queue in queue)"
-                       " on a port.\n\n"
+                       "vlan set (strip|filter|qinq|extend) (on|off) (port_id)\n"
+                       "    Set the VLAN strip or filter or qinq strip or extend\n\n"

                        "vlan set (inner|outer) tpid (value) (port_id)\n"
                        "    Set the VLAN TPID for Packet Filtering on"
@@ -3902,6 +3895,8 @@ cmd_vlan_offload_parsed(void *parsed_result,
        }
        else if (!strcmp(res->what, "filter"))
                rx_vlan_filter_set(port_id, on);
+       else if (!strcmp(res->what, "qinq"))
+               rx_vlan_qinq_strip_set(port_id, on);
        else
                vlan_extend_set(port_id, on);

@@ -3916,7 +3911,7 @@ cmdline_parse_token_string_t cmd_vlan_offload_set =
                                 set, "set");
 cmdline_parse_token_string_t cmd_vlan_offload_what =
        TOKEN_STRING_INITIALIZER(struct cmd_vlan_offload_result,
-                                what, "strip#filter#qinq#stripq");
+                                what, "strip#filter#qinq#extend#stripq");
 cmdline_parse_token_string_t cmd_vlan_offload_on =
        TOKEN_STRING_INITIALIZER(struct cmd_vlan_offload_result,
                              on, "on#off");
@@ -3927,9 +3922,9 @@ cmdline_parse_token_string_t cmd_vlan_offload_portid =
 cmdline_parse_inst_t cmd_vlan_offload = {
        .f = cmd_vlan_offload_parsed,
        .data = NULL,
-       .help_str = "vlan set strip|filter|qinq|stripq on|off "
+       .help_str = "vlan set strip|filter|qinq|extend|stripq on|off "
                "<port_id[,queue_id]>: "
-               "Filter/Strip for rx side qinq(extended) for both rx/tx sides",
+               "Strip/Filter/QinQ for rx side Extend for both rx/tx sides",
        .tokens = {
                (void *)&cmd_vlan_offload_vlan,
                (void *)&cmd_vlan_offload_set,
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 1a5a5c1..372ca54 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -2985,6 +2985,33 @@ rx_vlan_filter_set(portid_t port_id, int on)
        ports[port_id].dev_conf.rxmode.offloads = port_rx_offloads;
 }

+void
+rx_vlan_qinq_strip_set(portid_t port_id, int on)
+{
+       int diag;
+       int vlan_offload;
+       uint64_t port_rx_offloads = ports[port_id].dev_conf.rxmode.offloads;
+
+       if (port_id_is_invalid(port_id, ENABLED_WARN))
+               return;
+
+       vlan_offload = rte_eth_dev_get_vlan_offload(port_id);
+
+       if (on) {
+               vlan_offload |= ETH_QINQ_STRIP_OFFLOAD;
+               port_rx_offloads |= DEV_RX_OFFLOAD_QINQ_STRIP;
+       } else {
+               vlan_offload &= ~ETH_QINQ_STRIP_OFFLOAD;
+               port_rx_offloads &= ~DEV_RX_OFFLOAD_QINQ_STRIP;
+       }
+
+       diag = rte_eth_dev_set_vlan_offload(port_id, vlan_offload);
+       if (diag < 0)
+               printf("%s(port_pi=%d, on=%d) failed "
+              "diag=%d\n", __func__, port_id, on, diag);
+       ports[port_id].dev_conf.rxmode.offloads = port_rx_offloads;
+}
+
 int
 rx_vft_set(portid_t port_id, uint16_t vlan_id, int on)
 {
diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
index ce13eb8..05c8967 100644
--- a/app/test-pmd/testpmd.h
+++ b/app/test-pmd/testpmd.h
@@ -752,6 +752,7 @@ void rx_vlan_strip_set_on_queue(portid_t port_id, uint16_t queue_id, int on);

 void rx_vlan_filter_set(portid_t port_id, int on);
 void rx_vlan_all_filter_set(portid_t port_id, int on);
+void rx_vlan_qinq_strip_set(portid_t port_id, int on);
 int rx_vft_set(portid_t port_id, uint16_t vlan_id, int on);
 void vlan_extend_set(portid_t port_id, int on);
 void vlan_tpid_set(portid_t port_id, enum rte_vlan_type vlan_type,
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index 67f4339..0029865 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -799,13 +799,6 @@ Set broadcast mode for a VF from the PF::

    testpmd> set vf broadcast (port_id) (vf_id) (on|off)

-vlan set strip
-~~~~~~~~~~~~~~
-
-Set the VLAN strip on a port::
-
-   testpmd> vlan set strip (on|off) (port_id)
-
 vlan set stripq
 ~~~~~~~~~~~~~~~

@@ -841,19 +834,11 @@ Set VLAN antispoof for a VF from the PF::

    testpmd> set vf vlan antispoof (port_id) (vf_id) (on|off)

-vlan set filter
-~~~~~~~~~~~~~~~
-
-Set the VLAN filter on a port::
-
-   testpmd> vlan set filter (on|off) (port_id)
-
-vlan set qinq
-~~~~~~~~~~~~~
-
-Set the VLAN QinQ (extended queue in queue) on for a port::
+vlan set (strip|filter|qinq|extend)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Set the VLAN strip/filter/QinQ strip/extend on for a port::

-   testpmd> vlan set qinq (on|off) (port_id)
+   testpmd> vlan set (strip|filter|qinq|extend) (on|off) (port_id)

 vlan set tpid
 ~~~~~~~~~~~~~
--
2.7.4


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [dpdk-dev] [PATCH] app/testpmd: support QinQ offload in VLAN set command
  2019-09-13 12:15 [dpdk-dev] [PATCH] app/testpmd: support QinQ offload in VLAN set command viveksharma
  2019-09-29  4:28 ` Vivek Kumar Sharma
@ 2019-10-09 12:56 ` Ferruh Yigit
  2019-10-10  7:20   ` Vivek Sharma
  2019-10-11  4:05 ` [dpdk-dev] [PATCH v2] " viveksharma
  2 siblings, 1 reply; 9+ messages in thread
From: Ferruh Yigit @ 2019-10-09 12:56 UTC (permalink / raw)
  To: viveksharma, dev; +Cc: intoviveksharma

On 9/13/2019 1:15 PM, viveksharma@marvell.com wrote:
> From: Vivek Sharma <viveksharma@marvell.com>
> 
> Segregate QinQ from Extend Offload and support QinQ offload
> in vlan set command. Merge all port wise rx vlan offloads in
> command line help and documentation for a cleaner structure.
> 
> Signed-off-by: Vivek Sharma <viveksharma@marvell.com>

<...>

> @@ -3902,6 +3895,8 @@ cmd_vlan_offload_parsed(void *parsed_result,
>  	}
>  	else if (!strcmp(res->what, "filter"))
>  		rx_vlan_filter_set(port_id, on);
> +	else if (!strcmp(res->what, "qinq"))

Indeed this is enabling QinQ strip, what do you think calling it 'qinq_strip'?

> +		rx_vlan_qinq_strip_set(port_id, on);
>  	else
>  		vlan_extend_set(port_id, on);
>  
> @@ -3916,7 +3911,7 @@ cmdline_parse_token_string_t cmd_vlan_offload_set =
>  				 set, "set");
>  cmdline_parse_token_string_t cmd_vlan_offload_what =
>  	TOKEN_STRING_INITIALIZER(struct cmd_vlan_offload_result,
> -				 what, "strip#filter#qinq#stripq");
> +				 what, "strip#filter#qinq#extend#stripq");
>  cmdline_parse_token_string_t cmd_vlan_offload_on =
>  	TOKEN_STRING_INITIALIZER(struct cmd_vlan_offload_result,
>  			      on, "on#off");
> @@ -3927,9 +3922,9 @@ cmdline_parse_token_string_t cmd_vlan_offload_portid =
>  cmdline_parse_inst_t cmd_vlan_offload = {
>  	.f = cmd_vlan_offload_parsed,
>  	.data = NULL,
> -	.help_str = "vlan set strip|filter|qinq|stripq on|off "
> +	.help_str = "vlan set strip|filter|qinq|extend|stripq on|off "

"show port info ..." command ('port_infos_display()') displays the vlan offloads
too, can you please add displaying 'qinq' support too.

btw, it displays line by line:
VLAN offload:
  strip off
  filter on
  qinq(extend) off

perhaps we can flatten it, to reduce the info length, what do you think?
VLAN offload:
  strip off,  filter on, qinq(extend) off, qinq off

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [dpdk-dev] [PATCH] app/testpmd: support QinQ offload in VLAN set command
  2019-10-09 12:56 ` Ferruh Yigit
@ 2019-10-10  7:20   ` Vivek Sharma
  2019-10-10 10:24     ` Ferruh Yigit
  0 siblings, 1 reply; 9+ messages in thread
From: Vivek Sharma @ 2019-10-10  7:20 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: Vivek Kumar Sharma, dev

On Wed, Oct 9, 2019 at 6:26 PM Ferruh Yigit <ferruh.yigit@intel.com> wrote:

> On 9/13/2019 1:15 PM, viveksharma@marvell.com wrote:
> > From: Vivek Sharma <viveksharma@marvell.com>
> >
> > Segregate QinQ from Extend Offload and support QinQ offload
> > in vlan set command. Merge all port wise rx vlan offloads in
> > command line help and documentation for a cleaner structure.
> >
> > Signed-off-by: Vivek Sharma <viveksharma@marvell.com>
>
> <...>
>
> > @@ -3902,6 +3895,8 @@ cmd_vlan_offload_parsed(void *parsed_result,
> >       }
> >       else if (!strcmp(res->what, "filter"))
> >               rx_vlan_filter_set(port_id, on);
> > +     else if (!strcmp(res->what, "qinq"))
>
> Indeed this is enabling QinQ strip, what do you think calling it
> 'qinq_strip'?
>

Agreed!


>
> > +             rx_vlan_qinq_strip_set(port_id, on);
> >       else
> >               vlan_extend_set(port_id, on);
> >
> > @@ -3916,7 +3911,7 @@ cmdline_parse_token_string_t cmd_vlan_offload_set =
> >                                set, "set");
> >  cmdline_parse_token_string_t cmd_vlan_offload_what =
> >       TOKEN_STRING_INITIALIZER(struct cmd_vlan_offload_result,
> > -                              what, "strip#filter#qinq#stripq");
> > +                              what, "strip#filter#qinq#extend#stripq");
> >  cmdline_parse_token_string_t cmd_vlan_offload_on =
> >       TOKEN_STRING_INITIALIZER(struct cmd_vlan_offload_result,
> >                             on, "on#off");
> > @@ -3927,9 +3922,9 @@ cmdline_parse_token_string_t
> cmd_vlan_offload_portid =
> >  cmdline_parse_inst_t cmd_vlan_offload = {
> >       .f = cmd_vlan_offload_parsed,
> >       .data = NULL,
> > -     .help_str = "vlan set strip|filter|qinq|stripq on|off "
> > +     .help_str = "vlan set strip|filter|qinq|extend|stripq on|off "
>
> "show port info ..." command ('port_infos_display()') displays the vlan
> offloads
> too, can you please add displaying 'qinq' support too.
>

This is already implemented in another patch which introduces 'qinq
offload'.


>
> btw, it displays line by line:
> VLAN offload:
>   strip off
>   filter on
>   qinq(extend) off
>
> perhaps we can flatten it, to reduce the info length, what do you think?
>

Absolutely. In fact, I thought about doing so in the original patch.


> VLAN offload:
>   strip off,  filter on, qinq(extend) off, qinq off
>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [dpdk-dev] [PATCH] app/testpmd: support QinQ offload in VLAN set command
  2019-10-10  7:20   ` Vivek Sharma
@ 2019-10-10 10:24     ` Ferruh Yigit
  2019-10-10 10:28       ` Ferruh Yigit
  2019-10-10 10:31       ` Vivek Sharma
  0 siblings, 2 replies; 9+ messages in thread
From: Ferruh Yigit @ 2019-10-10 10:24 UTC (permalink / raw)
  To: Vivek Sharma; +Cc: Vivek Kumar Sharma, dev

On 10/10/2019 8:20 AM, Vivek Sharma wrote:
> On Wed, Oct 9, 2019 at 6:26 PM Ferruh Yigit <ferruh.yigit@intel.com
> <mailto:ferruh.yigit@intel.com>> wrote:
> 
>     On 9/13/2019 1:15 PM, viveksharma@marvell.com
>     <mailto:viveksharma@marvell.com> wrote:
>     > From: Vivek Sharma <viveksharma@marvell.com <mailto:viveksharma@marvell.com>>
>     >
>     > Segregate QinQ from Extend Offload and support QinQ offload
>     > in vlan set command. Merge all port wise rx vlan offloads in
>     > command line help and documentation for a cleaner structure.
>     >
>     > Signed-off-by: Vivek Sharma <viveksharma@marvell.com
>     <mailto:viveksharma@marvell.com>>
> 
>     <...>
> 
>     > @@ -3902,6 +3895,8 @@ cmd_vlan_offload_parsed(void *parsed_result,
>     >       }
>     >       else if (!strcmp(res->what, "filter"))
>     >               rx_vlan_filter_set(port_id, on);
>     > +     else if (!strcmp(res->what, "qinq"))
> 
>     Indeed this is enabling QinQ strip, what do you think calling it 'qinq_strip'?
> 
> 
> Agreed!
>  
> 
> 
>     > +             rx_vlan_qinq_strip_set(port_id, on);
>     >       else
>     >               vlan_extend_set(port_id, on);
>     > 
>     > @@ -3916,7 +3911,7 @@ cmdline_parse_token_string_t cmd_vlan_offload_set =
>     >                                set, "set");
>     >  cmdline_parse_token_string_t cmd_vlan_offload_what =
>     >       TOKEN_STRING_INITIALIZER(struct cmd_vlan_offload_result,
>     > -                              what, "strip#filter#qinq#stripq");
>     > +                              what, "strip#filter#qinq#extend#stripq");
>     >  cmdline_parse_token_string_t cmd_vlan_offload_on =
>     >       TOKEN_STRING_INITIALIZER(struct cmd_vlan_offload_result,
>     >                             on, "on#off");
>     > @@ -3927,9 +3922,9 @@ cmdline_parse_token_string_t cmd_vlan_offload_portid =
>     >  cmdline_parse_inst_t cmd_vlan_offload = {
>     >       .f = cmd_vlan_offload_parsed,
>     >       .data = NULL,
>     > -     .help_str = "vlan set strip|filter|qinq|stripq on|off "
>     > +     .help_str = "vlan set strip|filter|qinq|extend|stripq on|off "
> 
>     "show port info ..." command ('port_infos_display()') displays the vlan offloads
>     too, can you please add displaying 'qinq' support too.
> 
> 
> This is already implemented in another patch which introduces 'qinq offload'. 

Right, I found it [1], but I believe that change suits better here. Since you
are the author of both patch, would you mind I include that bit into this patch
while merging?

[1]
https://patches.dpdk.org/patch/60847/

>  
> 
> 
>     btw, it displays line by line:
>     VLAN offload:
>       strip off
>       filter on
>       qinq(extend) off
> 
>     perhaps we can flatten it, to reduce the info length, what do you think?
> 
> 
> Absolutely. In fact, I thought about doing so in the original patch.

I was hoping the change can be part of your patch, but since it is already out
this can be done as separate patch later.

>  
> 
>     VLAN offload:
>       strip off,  filter on, qinq(extend) off, qinq off
> 


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [dpdk-dev] [PATCH] app/testpmd: support QinQ offload in VLAN set command
  2019-10-10 10:24     ` Ferruh Yigit
@ 2019-10-10 10:28       ` Ferruh Yigit
  2019-10-10 10:31       ` Vivek Sharma
  1 sibling, 0 replies; 9+ messages in thread
From: Ferruh Yigit @ 2019-10-10 10:28 UTC (permalink / raw)
  To: Vivek Sharma; +Cc: Vivek Kumar Sharma, dev

On 10/10/2019 11:24 AM, Ferruh Yigit wrote:
> On 10/10/2019 8:20 AM, Vivek Sharma wrote:
>> On Wed, Oct 9, 2019 at 6:26 PM Ferruh Yigit <ferruh.yigit@intel.com
>> <mailto:ferruh.yigit@intel.com>> wrote:
>>
>>     On 9/13/2019 1:15 PM, viveksharma@marvell.com
>>     <mailto:viveksharma@marvell.com> wrote:
>>     > From: Vivek Sharma <viveksharma@marvell.com <mailto:viveksharma@marvell.com>>
>>     >
>>     > Segregate QinQ from Extend Offload and support QinQ offload
>>     > in vlan set command. Merge all port wise rx vlan offloads in
>>     > command line help and documentation for a cleaner structure.
>>     >
>>     > Signed-off-by: Vivek Sharma <viveksharma@marvell.com
>>     <mailto:viveksharma@marvell.com>>
>>
>>     <...>
>>
>>     > @@ -3902,6 +3895,8 @@ cmd_vlan_offload_parsed(void *parsed_result,
>>     >       }
>>     >       else if (!strcmp(res->what, "filter"))
>>     >               rx_vlan_filter_set(port_id, on);
>>     > +     else if (!strcmp(res->what, "qinq"))
>>
>>     Indeed this is enabling QinQ strip, what do you think calling it 'qinq_strip'?
>>
>>
>> Agreed!
>>  
>>
>>
>>     > +             rx_vlan_qinq_strip_set(port_id, on);
>>     >       else
>>     >               vlan_extend_set(port_id, on);
>>     > 
>>     > @@ -3916,7 +3911,7 @@ cmdline_parse_token_string_t cmd_vlan_offload_set =
>>     >                                set, "set");
>>     >  cmdline_parse_token_string_t cmd_vlan_offload_what =
>>     >       TOKEN_STRING_INITIALIZER(struct cmd_vlan_offload_result,
>>     > -                              what, "strip#filter#qinq#stripq");
>>     > +                              what, "strip#filter#qinq#extend#stripq");
>>     >  cmdline_parse_token_string_t cmd_vlan_offload_on =
>>     >       TOKEN_STRING_INITIALIZER(struct cmd_vlan_offload_result,
>>     >                             on, "on#off");
>>     > @@ -3927,9 +3922,9 @@ cmdline_parse_token_string_t cmd_vlan_offload_portid =
>>     >  cmdline_parse_inst_t cmd_vlan_offload = {
>>     >       .f = cmd_vlan_offload_parsed,
>>     >       .data = NULL,
>>     > -     .help_str = "vlan set strip|filter|qinq|stripq on|off "
>>     > +     .help_str = "vlan set strip|filter|qinq|extend|stripq on|off "
>>
>>     "show port info ..." command ('port_infos_display()') displays the vlan offloads
>>     too, can you please add displaying 'qinq' support too.
>>
>>
>> This is already implemented in another patch which introduces 'qinq offload'. 
> 
> Right, I found it [1], but I believe that change suits better here. Since you
> are the author of both patch, would you mind I include that bit into this patch
> while merging?

Ahh, I missed that there will be a new version of this patch, so would you mind
getting that bit into next version? I can take care of other patch while merging.

And since that part will be in this patch, can you also implement below flattening?

> 
> [1]
> https://patches.dpdk.org/patch/60847/
> 
>>  
>>
>>
>>     btw, it displays line by line:
>>     VLAN offload:
>>       strip off
>>       filter on
>>       qinq(extend) off
>>
>>     perhaps we can flatten it, to reduce the info length, what do you think?
>>
>>
>> Absolutely. In fact, I thought about doing so in the original patch.
> 
> I was hoping the change can be part of your patch, but since it is already out
> this can be done as separate patch later.
> 
>>  
>>
>>     VLAN offload:
>>       strip off,  filter on, qinq(extend) off, qinq off
>>
> 


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [dpdk-dev] [PATCH] app/testpmd: support QinQ offload in VLAN set command
  2019-10-10 10:24     ` Ferruh Yigit
  2019-10-10 10:28       ` Ferruh Yigit
@ 2019-10-10 10:31       ` Vivek Sharma
  1 sibling, 0 replies; 9+ messages in thread
From: Vivek Sharma @ 2019-10-10 10:31 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: Vivek Kumar Sharma, dev

On Thu, Oct 10, 2019 at 3:54 PM Ferruh Yigit <ferruh.yigit@intel.com> wrote:

> On 10/10/2019 8:20 AM, Vivek Sharma wrote:
> > On Wed, Oct 9, 2019 at 6:26 PM Ferruh Yigit <ferruh.yigit@intel.com
> > <mailto:ferruh.yigit@intel.com>> wrote:
> >
> >     On 9/13/2019 1:15 PM, viveksharma@marvell.com
> >     <mailto:viveksharma@marvell.com> wrote:
> >     > From: Vivek Sharma <viveksharma@marvell.com <mailto:
> viveksharma@marvell.com>>
> >     >
> >     > Segregate QinQ from Extend Offload and support QinQ offload
> >     > in vlan set command. Merge all port wise rx vlan offloads in
> >     > command line help and documentation for a cleaner structure.
> >     >
> >     > Signed-off-by: Vivek Sharma <viveksharma@marvell.com
> >     <mailto:viveksharma@marvell.com>>
> >
> >     <...>
> >
> >     > @@ -3902,6 +3895,8 @@ cmd_vlan_offload_parsed(void *parsed_result,
> >     >       }
> >     >       else if (!strcmp(res->what, "filter"))
> >     >               rx_vlan_filter_set(port_id, on);
> >     > +     else if (!strcmp(res->what, "qinq"))
> >
> >     Indeed this is enabling QinQ strip, what do you think calling it
> 'qinq_strip'?
> >
> >
> > Agreed!
> >
> >
> >
> >     > +             rx_vlan_qinq_strip_set(port_id, on);
> >     >       else
> >     >               vlan_extend_set(port_id, on);
> >     >
> >     > @@ -3916,7 +3911,7 @@ cmdline_parse_token_string_t
> cmd_vlan_offload_set =
> >     >                                set, "set");
> >     >  cmdline_parse_token_string_t cmd_vlan_offload_what =
> >     >       TOKEN_STRING_INITIALIZER(struct cmd_vlan_offload_result,
> >     > -                              what, "strip#filter#qinq#stripq");
> >     > +                              what,
> "strip#filter#qinq#extend#stripq");
> >     >  cmdline_parse_token_string_t cmd_vlan_offload_on =
> >     >       TOKEN_STRING_INITIALIZER(struct cmd_vlan_offload_result,
> >     >                             on, "on#off");
> >     > @@ -3927,9 +3922,9 @@ cmdline_parse_token_string_t
> cmd_vlan_offload_portid =
> >     >  cmdline_parse_inst_t cmd_vlan_offload = {
> >     >       .f = cmd_vlan_offload_parsed,
> >     >       .data = NULL,
> >     > -     .help_str = "vlan set strip|filter|qinq|stripq on|off "
> >     > +     .help_str = "vlan set strip|filter|qinq|extend|stripq on|off
> "
> >
> >     "show port info ..." command ('port_infos_display()') displays the
> vlan offloads
> >     too, can you please add displaying 'qinq' support too.
> >
> >
> > This is already implemented in another patch which introduces 'qinq
> offload'.
>
> Right, I found it [1], but I believe that change suits better here. Since
> you
> are the author of both patch, would you mind I include that bit into this
> patch
> while merging?
>
>
Sure, please go ahead! Anyways, I was planning to send v2 of both the
patches, which would take
care of all the valid points raised by you.


> [1]
> https://patches.dpdk.org/patch/60847/
>
> >
> >
> >
> >     btw, it displays line by line:
> >     VLAN offload:
> >       strip off
> >       filter on
> >       qinq(extend) off
> >
> >     perhaps we can flatten it, to reduce the info length, what do you
> think?
> >
> >
> > Absolutely. In fact, I thought about doing so in the original patch.
>
> I was hoping the change can be part of your patch, but since it is already
> out
> this can be done as separate patch later.
>
> >
> >
> >     VLAN offload:
> >       strip off,  filter on, qinq(extend) off, qinq off
> >
>
>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [dpdk-dev] [PATCH v2] app/testpmd: support QinQ offload in VLAN set command
  2019-09-13 12:15 [dpdk-dev] [PATCH] app/testpmd: support QinQ offload in VLAN set command viveksharma
  2019-09-29  4:28 ` Vivek Kumar Sharma
  2019-10-09 12:56 ` Ferruh Yigit
@ 2019-10-11  4:05 ` viveksharma
  2019-10-14 10:40   ` Ferruh Yigit
  2 siblings, 1 reply; 9+ messages in thread
From: viveksharma @ 2019-10-11  4:05 UTC (permalink / raw)
  To: dev; +Cc: intoviveksharma, ferruh.yigit, Vivek Sharma

From: Vivek Sharma <viveksharma@marvell.com>

Segregate QinQ from Extend Offload and support QinQ offload
in vlan set command. Merge all port wise rx vlan offloads in
command line help and documentation for a cleaner structure.

Fix port info display to distinguish between qinq strip and
extend offloads. Flatten all VLAN offload info into a single
line to reduce info length.

Signed-off-by: Vivek Sharma <viveksharma@marvell.com>
---
v2:
* Added fix for port info display.
* Flattened port info display VLAN info.

 app/test-pmd/cmdline.c                      | 19 +++++--------
 app/test-pmd/config.c                       | 44 +++++++++++++++++++++++++----
 app/test-pmd/testpmd.h                      |  1 +
 doc/guides/testpmd_app_ug/testpmd_funcs.rst | 29 ++++---------------
 4 files changed, 52 insertions(+), 41 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index b1be6b4..291effe 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -325,9 +325,6 @@ static void cmd_help_long_parsed(void *parsed_result,
 			"set vf broadcast (port_id) (vf_id) (on|off)\n"
 			"    Set VF broadcast for a VF from the PF.\n\n"
 
-			"vlan set strip (on|off) (port_id)\n"
-			"    Set the VLAN strip on a port.\n\n"
-
 			"vlan set stripq (on|off) (port_id,queue_id)\n"
 			"    Set the VLAN strip for a queue on a port.\n\n"
 
@@ -358,12 +355,8 @@ static void cmd_help_long_parsed(void *parsed_result,
 			"set tc tx min-bandwidth (port_id) (bw1, bw2, ...)\n"
 			"    Set all TCs' min bandwidth(%%) for all PF and VFs.\n\n"
 
-			"vlan set filter (on|off) (port_id)\n"
-			"    Set the VLAN filter on a port.\n\n"
-
-			"vlan set qinq (on|off) (port_id)\n"
-			"    Set the VLAN QinQ (extended queue in queue)"
-			" on a port.\n\n"
+			"vlan set (strip|filter|qinq_strip|extend) (on|off) (port_id)\n"
+			"    Set the VLAN strip or filter or qinq strip or extend\n\n"
 
 			"vlan set (inner|outer) tpid (value) (port_id)\n"
 			"    Set the VLAN TPID for Packet Filtering on"
@@ -3918,6 +3911,8 @@ cmd_vlan_offload_parsed(void *parsed_result,
 	}
 	else if (!strcmp(res->what, "filter"))
 		rx_vlan_filter_set(port_id, on);
+	else if (!strcmp(res->what, "qinq_strip"))
+		rx_vlan_qinq_strip_set(port_id, on);
 	else
 		vlan_extend_set(port_id, on);
 
@@ -3932,7 +3927,7 @@ cmdline_parse_token_string_t cmd_vlan_offload_set =
 				 set, "set");
 cmdline_parse_token_string_t cmd_vlan_offload_what =
 	TOKEN_STRING_INITIALIZER(struct cmd_vlan_offload_result,
-				 what, "strip#filter#qinq#stripq");
+				what, "strip#filter#qinq_strip#extend#stripq");
 cmdline_parse_token_string_t cmd_vlan_offload_on =
 	TOKEN_STRING_INITIALIZER(struct cmd_vlan_offload_result,
 			      on, "on#off");
@@ -3943,9 +3938,9 @@ cmdline_parse_token_string_t cmd_vlan_offload_portid =
 cmdline_parse_inst_t cmd_vlan_offload = {
 	.f = cmd_vlan_offload_parsed,
 	.data = NULL,
-	.help_str = "vlan set strip|filter|qinq|stripq on|off "
+	.help_str = "vlan set strip|filter|qinq_strip|extend|stripq on|off "
 		"<port_id[,queue_id]>: "
-		"Filter/Strip for rx side qinq(extended) for both rx/tx sides",
+		"Strip/Filter/QinQ for rx side Extend for both rx/tx sides",
 	.tokens = {
 		(void *)&cmd_vlan_offload_vlan,
 		(void *)&cmd_vlan_offload_set,
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 24158e5..e428ea8 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -524,19 +524,24 @@ port_infos_display(portid_t port_id)
 	if (vlan_offload >= 0){
 		printf("VLAN offload: \n");
 		if (vlan_offload & ETH_VLAN_STRIP_OFFLOAD)
-			printf("  strip on \n");
+			printf("  strip on, ");
 		else
-			printf("  strip off \n");
+			printf("  strip off, ");
 
 		if (vlan_offload & ETH_VLAN_FILTER_OFFLOAD)
-			printf("  filter on \n");
+			printf("filter on, ");
 		else
-			printf("  filter off \n");
+			printf("filter off, ");
 
 		if (vlan_offload & ETH_VLAN_EXTEND_OFFLOAD)
-			printf("  qinq(extend) on \n");
+			printf("extend on, ");
 		else
-			printf("  qinq(extend) off \n");
+			printf("extend off, ");
+
+		if (vlan_offload & ETH_QINQ_STRIP_OFFLOAD)
+			printf("qinq strip on\n");
+		else
+			printf("qinq strip off\n");
 	}
 
 	if (dev_info.hash_key_size > 0)
@@ -3028,6 +3033,33 @@ rx_vlan_filter_set(portid_t port_id, int on)
 	ports[port_id].dev_conf.rxmode.offloads = port_rx_offloads;
 }
 
+void
+rx_vlan_qinq_strip_set(portid_t port_id, int on)
+{
+	int diag;
+	int vlan_offload;
+	uint64_t port_rx_offloads = ports[port_id].dev_conf.rxmode.offloads;
+
+	if (port_id_is_invalid(port_id, ENABLED_WARN))
+		return;
+
+	vlan_offload = rte_eth_dev_get_vlan_offload(port_id);
+
+	if (on) {
+		vlan_offload |= ETH_QINQ_STRIP_OFFLOAD;
+		port_rx_offloads |= DEV_RX_OFFLOAD_QINQ_STRIP;
+	} else {
+		vlan_offload &= ~ETH_QINQ_STRIP_OFFLOAD;
+		port_rx_offloads &= ~DEV_RX_OFFLOAD_QINQ_STRIP;
+	}
+
+	diag = rte_eth_dev_set_vlan_offload(port_id, vlan_offload);
+	if (diag < 0)
+		printf("%s(port_pi=%d, on=%d) failed "
+	       "diag=%d\n", __func__, port_id, on, diag);
+	ports[port_id].dev_conf.rxmode.offloads = port_rx_offloads;
+}
+
 int
 rx_vft_set(portid_t port_id, uint16_t vlan_id, int on)
 {
diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
index d73955d..f729649 100644
--- a/app/test-pmd/testpmd.h
+++ b/app/test-pmd/testpmd.h
@@ -752,6 +752,7 @@ void rx_vlan_strip_set_on_queue(portid_t port_id, uint16_t queue_id, int on);
 
 void rx_vlan_filter_set(portid_t port_id, int on);
 void rx_vlan_all_filter_set(portid_t port_id, int on);
+void rx_vlan_qinq_strip_set(portid_t port_id, int on);
 int rx_vft_set(portid_t port_id, uint16_t vlan_id, int on);
 void vlan_extend_set(portid_t port_id, int on);
 void vlan_tpid_set(portid_t port_id, enum rte_vlan_type vlan_type,
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index 67f4339..53e05ef 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -198,9 +198,7 @@ For example:
    Maximum number of MAC addresses: 64
    Maximum number of MAC addresses of hash filtering: 0
    VLAN offload:
-       strip on
-       filter on
-       qinq(extend) off
+       strip on, filter on, extend off, qinq strip off
    Redirection table size: 512
    Supported flow types:
      ipv4-frag
@@ -799,13 +797,6 @@ Set broadcast mode for a VF from the PF::
 
    testpmd> set vf broadcast (port_id) (vf_id) (on|off)
 
-vlan set strip
-~~~~~~~~~~~~~~
-
-Set the VLAN strip on a port::
-
-   testpmd> vlan set strip (on|off) (port_id)
-
 vlan set stripq
 ~~~~~~~~~~~~~~~
 
@@ -841,19 +832,11 @@ Set VLAN antispoof for a VF from the PF::
 
    testpmd> set vf vlan antispoof (port_id) (vf_id) (on|off)
 
-vlan set filter
-~~~~~~~~~~~~~~~
-
-Set the VLAN filter on a port::
-
-   testpmd> vlan set filter (on|off) (port_id)
-
-vlan set qinq
-~~~~~~~~~~~~~
-
-Set the VLAN QinQ (extended queue in queue) on for a port::
+vlan set (strip|filter|qinq_strip|extend)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Set the VLAN strip/filter/QinQ strip/extend on for a port::
 
-   testpmd> vlan set qinq (on|off) (port_id)
+   testpmd> vlan set (strip|filter|qinq_strip|extend) (on|off) (port_id)
 
 vlan set tpid
 ~~~~~~~~~~~~~
@@ -4359,7 +4342,7 @@ Sample QinQ flow rules
 Before creating QinQ rule(s) the following commands should be issued to enable QinQ::
 
    testpmd> port stop 0
-   testpmd> vlan set qinq on 0
+   testpmd> vlan set qinq_strip on 0
 
 The above command sets the inner and outer TPID's to 0x8100.
 
-- 
2.7.4


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [dpdk-dev] [PATCH v2] app/testpmd: support QinQ offload in VLAN set command
  2019-10-11  4:05 ` [dpdk-dev] [PATCH v2] " viveksharma
@ 2019-10-14 10:40   ` Ferruh Yigit
  0 siblings, 0 replies; 9+ messages in thread
From: Ferruh Yigit @ 2019-10-14 10:40 UTC (permalink / raw)
  To: viveksharma, dev; +Cc: intoviveksharma

On 10/11/2019 5:05 AM, viveksharma@marvell.com wrote:
> From: Vivek Sharma <viveksharma@marvell.com>
> 
> Segregate QinQ from Extend Offload and support QinQ offload
> in vlan set command. Merge all port wise rx vlan offloads in
> command line help and documentation for a cleaner structure.
> 
> Fix port info display to distinguish between qinq strip and
> extend offloads. Flatten all VLAN offload info into a single
> line to reduce info length.
> 
> Signed-off-by: Vivek Sharma <viveksharma@marvell.com>

Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>

Applied to dpdk-next-net/master, thanks.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2019-10-14 10:40 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-13 12:15 [dpdk-dev] [PATCH] app/testpmd: support QinQ offload in VLAN set command viveksharma
2019-09-29  4:28 ` Vivek Kumar Sharma
2019-10-09 12:56 ` Ferruh Yigit
2019-10-10  7:20   ` Vivek Sharma
2019-10-10 10:24     ` Ferruh Yigit
2019-10-10 10:28       ` Ferruh Yigit
2019-10-10 10:31       ` Vivek Sharma
2019-10-11  4:05 ` [dpdk-dev] [PATCH v2] " viveksharma
2019-10-14 10:40   ` Ferruh Yigit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).