[dpdk-dev,v5] app/testpmd: supported offload capabilities query

Message ID 1484191582-17293-1-git-send-email-qiming.yang@intel.com (mailing list archive)
State Superseded, archived
Headers

Checks

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

Commit Message

Qiming Yang Jan. 12, 2017, 3:26 a.m. UTC
  Add two new commands "show port cap <port>" and "show
port cap all"to diaplay what offload capabilities supported
in ports. It will not only display all the capabilities of
the port, but also the enabling condition for each capability
in the running time.

Signed-off-by: Qiming Yang <qiming.yang@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
---
v2 changes:
* fixed the output style as Ferruh's patch show and add some
  description in docs for new functions.
v3 changes:
* add new command in cmd_help_long_parsed.
v4 changes:
* use 'cap' instead of 'capa'.
v5 changes:
* rebased, fixed the inappropriate expression and adjusted the
  output order.
---
---
 app/test-pmd/cmdline.c                      |  17 ++-
 app/test-pmd/config.c                       | 175 ++++++++++++++++++++++++++++
 app/test-pmd/testpmd.h                      |   1 +
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  12 +-
 4 files changed, 195 insertions(+), 10 deletions(-)
  

Comments

De Lara Guarch, Pablo Jan. 13, 2017, 8:43 a.m. UTC | #1
Hi Qiming,

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Qiming Yang
> Sent: Thursday, January 12, 2017 3:26 AM
> To: dev@dpdk.org
> Cc: Yang, Qiming
> Subject: [dpdk-dev] [PATCH v5] app/testpmd: supported offload capabilities
> query
> 
> Add two new commands "show port cap <port>" and "show
> port cap all"to diaplay what offload capabilities supported
> in ports. It will not only display all the capabilities of
> the port, but also the enabling condition for each capability
> in the running time.
> 
> Signed-off-by: Qiming Yang <qiming.yang@intel.com>
> Acked-by: Jingjing Wu <jingjing.wu@intel.com>
> Acked-by: Beilei Xing <beilei.xing@intel.com>
> ---
> v2 changes:
> * fixed the output style as Ferruh's patch show and add some
>   description in docs for new functions.
> v3 changes:
> * add new command in cmd_help_long_parsed.
> v4 changes:
> * use 'cap' instead of 'capa'.
> v5 changes:
> * rebased, fixed the inappropriate expression and adjusted the
>   output order.
> ---
> ---
>  app/test-pmd/cmdline.c                      |  17 ++-
>  app/test-pmd/config.c                       | 175
> ++++++++++++++++++++++++++++
>  app/test-pmd/testpmd.h                      |   1 +
>  doc/guides/testpmd_app_ug/testpmd_funcs.rst |  12 +-
>  4 files changed, 195 insertions(+), 10 deletions(-)
> 
> diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
> index 4e8b0d8..6fa1783 100644
> --- a/app/test-pmd/cmdline.c
> +++ b/app/test-pmd/cmdline.c

...

>  cmdline_parse_token_string_t cmd_showportall_show =
> @@ -5821,13 +5824,14 @@ cmdline_parse_token_string_t
> cmd_showportall_port =
>  	TOKEN_STRING_INITIALIZER(struct cmd_showportall_result, port,
> "port");
>  cmdline_parse_token_string_t cmd_showportall_what =
>  	TOKEN_STRING_INITIALIZER(struct cmd_showportall_result, what,
> -
> "info#stats#xstats#fdir#stat_qmap#dcb_tc");
> +
> "info#stats#xstats#fdir#stat_qmap#dcb_tc#cap");
>  cmdline_parse_token_string_t cmd_showportall_all =
>  	TOKEN_STRING_INITIALIZER(struct cmd_showportall_result, all,
> "all");
>  cmdline_parse_inst_t cmd_showportall = {
>  	.f = cmd_showportall_parsed,
>  	.data = NULL,
> -	.help_str = "show|clear port
> info|stats|xstats|fdir|stat_qmap|dcb_tc all",
> +	.help_str = "show|clear port"

Missing space after "port"

> +	"info|stats|xstats|fdir|stat_qmap|dcb_tc|cap all",
>  	.tokens = {
>  		(void *)&cmd_showportall_show,
>  		(void *)&cmd_showportall_port,
> @@ -5867,6 +5871,8 @@ static void cmd_showport_parsed(void
> *parsed_result,
>  		nic_stats_mapping_display(res->portnum);
>  	else if (!strcmp(res->what, "dcb_tc"))
>  		port_dcb_info_display(res->portnum);
> +	else if (!strcmp(res->what, "cap"))
> +		port_offload_cap_display(res->portnum);
>  }
> 
>  cmdline_parse_token_string_t cmd_showport_show =
> @@ -5876,14 +5882,15 @@ cmdline_parse_token_string_t
> cmd_showport_port =
>  	TOKEN_STRING_INITIALIZER(struct cmd_showport_result, port,
> "port");
>  cmdline_parse_token_string_t cmd_showport_what =
>  	TOKEN_STRING_INITIALIZER(struct cmd_showport_result, what,
> -
> "info#stats#xstats#fdir#stat_qmap#dcb_tc");
> +
> "info#stats#xstats#fdir#stat_qmap#dcb_tc#cap");
>  cmdline_parse_token_num_t cmd_showport_portnum =
>  	TOKEN_NUM_INITIALIZER(struct cmd_showport_result, portnum,
> UINT8);
> 
>  cmdline_parse_inst_t cmd_showport = {
>  	.f = cmd_showport_parsed,
>  	.data = NULL,
> -	.help_str = "show|clear port
> info|stats|xstats|fdir|stat_qmap|dcb_tc "
> +	.help_str = "show|clear port"

Missing space after "port".
Also, add a tab in the following line to be consistent with
the help_str of the next command.

> +		"info|stats|xstats|fdir|stat_qmap|dcb_tc|cap "
>  		"<port_id>",
>  	.tokens = {
>  		(void *)&cmd_showport_show,
> diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
> index 617e6d4..8a2ef56 100644
> --- a/app/test-pmd/config.c
> +++ b/app/test-pmd/config.c

...

> +
> +	if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_TCP_CKSUM) {
> +		printf("RX TCP checksum:               ");
> +		if (dev->data->dev_conf.rxmode.hw_ip_checksum)
> +			printf("on\n");
> +		else
> +			printf("off\n");
> +	}
> +
> +	if (dev_info.rx_offload_capa &
> DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM)
> +		printf("RX Outer IPv4 checksum:        ");

Missing on/off?

> +
> +	if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_TCP_LRO) {
> +		printf("Large receive offload:         ");
> +		if (dev->data->dev_conf.rxmode.enable_lro)
> +			printf("on\n");
> +		else
> +			printf("off\n");
> +	}

Thanks for this nice patch.

Pablo
  
Qiming Yang Jan. 13, 2017, 9:40 a.m. UTC | #2
Hi, Pablo

-----Original Message-----
From: De Lara Guarch, Pablo 
Sent: Friday, January 13, 2017 4:43 PM
To: Yang, Qiming <qiming.yang@intel.com>; dev@dpdk.org
Cc: Yang, Qiming <qiming.yang@intel.com>
Subject: RE: [dpdk-dev] [PATCH v5] app/testpmd: supported offload capabilities query

Hi Qiming,

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Qiming Yang
> Sent: Thursday, January 12, 2017 3:26 AM
> To: dev@dpdk.org
> Cc: Yang, Qiming
> Subject: [dpdk-dev] [PATCH v5] app/testpmd: supported offload 
> capabilities query
> 
> Add two new commands "show port cap <port>" and "show port cap all"to 
> diaplay what offload capabilities supported in ports. It will not only 
> display all the capabilities of the port, but also the enabling 
> condition for each capability in the running time.
> 
> Signed-off-by: Qiming Yang <qiming.yang@intel.com>
> Acked-by: Jingjing Wu <jingjing.wu@intel.com>
> Acked-by: Beilei Xing <beilei.xing@intel.com>
> ---
> v2 changes:
> * fixed the output style as Ferruh's patch show and add some
>   description in docs for new functions.
> v3 changes:
> * add new command in cmd_help_long_parsed.
> v4 changes:
> * use 'cap' instead of 'capa'.
> v5 changes:
> * rebased, fixed the inappropriate expression and adjusted the
>   output order.
> ---
> ---
>  app/test-pmd/cmdline.c                      |  17 ++-
>  app/test-pmd/config.c                       | 175
> ++++++++++++++++++++++++++++
>  app/test-pmd/testpmd.h                      |   1 +
>  doc/guides/testpmd_app_ug/testpmd_funcs.rst |  12 +-
>  4 files changed, 195 insertions(+), 10 deletions(-)
> 
> diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index 
> 4e8b0d8..6fa1783 100644
> --- a/app/test-pmd/cmdline.c
> +++ b/app/test-pmd/cmdline.c

...

>  cmdline_parse_token_string_t cmd_showportall_show = @@ -5821,13 
> +5824,14 @@ cmdline_parse_token_string_t cmd_showportall_port =
>  	TOKEN_STRING_INITIALIZER(struct cmd_showportall_result, port, 
> "port");  cmdline_parse_token_string_t cmd_showportall_what =
>  	TOKEN_STRING_INITIALIZER(struct cmd_showportall_result, what,
> -
> "info#stats#xstats#fdir#stat_qmap#dcb_tc");
> +
> "info#stats#xstats#fdir#stat_qmap#dcb_tc#cap");
>  cmdline_parse_token_string_t cmd_showportall_all =
>  	TOKEN_STRING_INITIALIZER(struct cmd_showportall_result, all, "all");  
> cmdline_parse_inst_t cmd_showportall = {
>  	.f = cmd_showportall_parsed,
>  	.data = NULL,
> -	.help_str = "show|clear port
> info|stats|xstats|fdir|stat_qmap|dcb_tc all",
> +	.help_str = "show|clear port"

Missing space after "port"

> +	"info|stats|xstats|fdir|stat_qmap|dcb_tc|cap all",
>  	.tokens = {
>  		(void *)&cmd_showportall_show,
>  		(void *)&cmd_showportall_port,
> @@ -5867,6 +5871,8 @@ static void cmd_showport_parsed(void 
> *parsed_result,
>  		nic_stats_mapping_display(res->portnum);
>  	else if (!strcmp(res->what, "dcb_tc"))
>  		port_dcb_info_display(res->portnum);
> +	else if (!strcmp(res->what, "cap"))
> +		port_offload_cap_display(res->portnum);
>  }
> 
>  cmdline_parse_token_string_t cmd_showport_show = @@ -5876,14 +5882,15 
> @@ cmdline_parse_token_string_t cmd_showport_port =
>  	TOKEN_STRING_INITIALIZER(struct cmd_showport_result, port, "port");  
> cmdline_parse_token_string_t cmd_showport_what =
>  	TOKEN_STRING_INITIALIZER(struct cmd_showport_result, what,
> -
> "info#stats#xstats#fdir#stat_qmap#dcb_tc");
> +
> "info#stats#xstats#fdir#stat_qmap#dcb_tc#cap");
>  cmdline_parse_token_num_t cmd_showport_portnum =
>  	TOKEN_NUM_INITIALIZER(struct cmd_showport_result, portnum, UINT8);
> 
>  cmdline_parse_inst_t cmd_showport = {
>  	.f = cmd_showport_parsed,
>  	.data = NULL,
> -	.help_str = "show|clear port
> info|stats|xstats|fdir|stat_qmap|dcb_tc "
> +	.help_str = "show|clear port"

Missing space after "port".
Also, add a tab in the following line to be consistent with the help_str of the next command.

> +		"info|stats|xstats|fdir|stat_qmap|dcb_tc|cap "
>  		"<port_id>",
>  	.tokens = {
>  		(void *)&cmd_showport_show,
> diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index 
> 617e6d4..8a2ef56 100644
> --- a/app/test-pmd/config.c
> +++ b/app/test-pmd/config.c

...

> +
> +	if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_TCP_CKSUM) {
> +		printf("RX TCP checksum:               ");
> +		if (dev->data->dev_conf.rxmode.hw_ip_checksum)
> +			printf("on\n");
> +		else
> +			printf("off\n");
> +	}
> +
> +	if (dev_info.rx_offload_capa &
> DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM)
> +		printf("RX Outer IPv4 checksum:        ");

Missing on/off?
Qiming: I didn't find any switch for this feature in DPDK now. I'll fix the format problem. Thank you.
> +
> +	if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_TCP_LRO) {
> +		printf("Large receive offload:         ");
> +		if (dev->data->dev_conf.rxmode.enable_lro)
> +			printf("on\n");
> +		else
> +			printf("off\n");
> +	}

Thanks for this nice patch.

Pablo
  
De Lara Guarch, Pablo Jan. 13, 2017, 12:35 p.m. UTC | #3
Hi Qiming,

> -----Original Message-----
> From: Yang, Qiming
> Sent: Friday, January 13, 2017 9:40 AM
> To: De Lara Guarch, Pablo; dev@dpdk.org
> Subject: RE: [dpdk-dev] [PATCH v5] app/testpmd: supported offload
> capabilities query
> 
> Hi, Pablo
> 
> -----Original Message-----
> From: De Lara Guarch, Pablo
> Sent: Friday, January 13, 2017 4:43 PM
> To: Yang, Qiming <qiming.yang@intel.com>; dev@dpdk.org
> Cc: Yang, Qiming <qiming.yang@intel.com>
> Subject: RE: [dpdk-dev] [PATCH v5] app/testpmd: supported offload
> capabilities query
> 
> Hi Qiming,
> 
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Qiming Yang
> > Sent: Thursday, January 12, 2017 3:26 AM
> > To: dev@dpdk.org
> > Cc: Yang, Qiming
> > Subject: [dpdk-dev] [PATCH v5] app/testpmd: supported offload
> > capabilities query
> >
> > Add two new commands "show port cap <port>" and "show port cap
> all"to
> > diaplay what offload capabilities supported in ports. It will not only
> > display all the capabilities of the port, but also the enabling
> > condition for each capability in the running time.
> >
> > Signed-off-by: Qiming Yang <qiming.yang@intel.com>
> > Acked-by: Jingjing Wu <jingjing.wu@intel.com>
> > Acked-by: Beilei Xing <beilei.xing@intel.com>
> > ---
> > v2 changes:
> > * fixed the output style as Ferruh's patch show and add some
> >   description in docs for new functions.
> > v3 changes:
> > * add new command in cmd_help_long_parsed.
> > v4 changes:
> > * use 'cap' instead of 'capa'.
> > v5 changes:
> > * rebased, fixed the inappropriate expression and adjusted the
> >   output order.
> > ---
> > ---
> >  app/test-pmd/cmdline.c                      |  17 ++-
> >  app/test-pmd/config.c                       | 175
> > ++++++++++++++++++++++++++++
> >  app/test-pmd/testpmd.h                      |   1 +
> >  doc/guides/testpmd_app_ug/testpmd_funcs.rst |  12 +-
> >  4 files changed, 195 insertions(+), 10 deletions(-)
> >
> > diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index
> > 4e8b0d8..6fa1783 100644
> > --- a/app/test-pmd/cmdline.c
> > +++ b/app/test-pmd/cmdline.c
> 
> ...
> 
> > +
> > +	if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_TCP_CKSUM) {
> > +		printf("RX TCP checksum:               ");
> > +		if (dev->data->dev_conf.rxmode.hw_ip_checksum)
> > +			printf("on\n");
> > +		else
> > +			printf("off\n");
> > +	}
> > +
> > +	if (dev_info.rx_offload_capa &
> > DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM)
> > +		printf("RX Outer IPv4 checksum:        ");
> 
> Missing on/off?
> Qiming: I didn't find any switch for this feature in DPDK now. I'll fix the
> format problem. Thank you.

I just saw your v6. So, what does this mean? If the device is capable of doing this,
but there is no way to enable/disable it, it would mean that it will be enabled or disabled by default, right?

I see that X550 NIC is the only one capable of this. Maybe Wenzhuo can help on clarifying this.

I would say that, if it is enabled when it is capable, then you should print "on",
But printing only "RX Outer IPv4 checksum" does not give any information (when all the rest of the capabilities show on/off).

Thanks,
Pablo
  
Qiming Yang Jan. 14, 2017, 3:06 a.m. UTC | #4
HI, Pablo

> ...
> 
> > +
> > +	if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_TCP_CKSUM) {
> > +		printf("RX TCP checksum:               ");
> > +		if (dev->data->dev_conf.rxmode.hw_ip_checksum)
> > +			printf("on\n");
> > +		else
> > +			printf("off\n");
> > +	}
> > +
> > +	if (dev_info.rx_offload_capa &
> > DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM)
> > +		printf("RX Outer IPv4 checksum:        ");
> 
> Missing on/off?
> Qiming: I didn't find any switch for this feature in DPDK now. I'll 
> fix the format problem. Thank you.

I just saw your v6. So, what does this mean? If the device is capable of doing this, but there is no way to enable/disable it, it would mean that it will be enabled or disabled by default, right?

I see that X550 NIC is the only one capable of this. Maybe Wenzhuo can help on clarifying this.

I would say that, if it is enabled when it is capable, then you should print "on", But printing only "RX Outer IPv4 checksum" does not give any information (when all the rest of the capabilities show on/off).

Qiming: Ok, I'll check with Wenzhuo, Thank you for your advice for the unsuitable print in this place .

Thanks,
Pablo
  
Qiming Yang Jan. 16, 2017, 2 a.m. UTC | #5
Hi, Pablo
I have checked with Wenzhuo, this capability has no way to disable and is always enable if NIC have this capability.
So I'll change the print to " RX Outer IPv4 checksum:        on".

-----Original Message-----
From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Yang, Qiming
Sent: Saturday, January 14, 2017 11:06 AM
To: De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>; dev@dpdk.org
Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>
Subject: Re: [dpdk-dev] [PATCH v5] app/testpmd: supported offload capabilities query

HI, Pablo

> ...
> 
> > +
> > +	if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_TCP_CKSUM) {
> > +		printf("RX TCP checksum:               ");
> > +		if (dev->data->dev_conf.rxmode.hw_ip_checksum)
> > +			printf("on\n");
> > +		else
> > +			printf("off\n");
> > +	}
> > +
> > +	if (dev_info.rx_offload_capa &
> > DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM)
> > +		printf("RX Outer IPv4 checksum:        ");
> 
> Missing on/off?
> Qiming: I didn't find any switch for this feature in DPDK now. I'll 
> fix the format problem. Thank you.

I just saw your v6. So, what does this mean? If the device is capable of doing this, but there is no way to enable/disable it, it would mean that it will be enabled or disabled by default, right?

I see that X550 NIC is the only one capable of this. Maybe Wenzhuo can help on clarifying this.

I would say that, if it is enabled when it is capable, then you should print "on", But printing only "RX Outer IPv4 checksum" does not give any information (when all the rest of the capabilities show on/off).

Qiming: Ok, I'll check with Wenzhuo, Thank you for your advice for the unsuitable print in this place .

Thanks,
Pablo
  

Patch

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 4e8b0d8..6fa1783 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -183,7 +183,7 @@  static void cmd_help_long_parsed(void *parsed_result,
 			"Display:\n"
 			"--------\n\n"
 
-			"show port (info|stats|xstats|fdir|stat_qmap|dcb_tc) (port_id|all)\n"
+			"show port (info|stats|xstats|fdir|stat_qmap|dcb_tc|cap) (port_id|all)\n"
 			"    Display information for port_id, or all.\n\n"
 
 			"show port X rss reta (size) (mask0,mask1,...)\n"
@@ -5812,6 +5812,9 @@  static void cmd_showportall_parsed(void *parsed_result,
 	else if (!strcmp(res->what, "dcb_tc"))
 		FOREACH_PORT(i, ports)
 			port_dcb_info_display(i);
+	else if (!strcmp(res->what, "cap"))
+		FOREACH_PORT(i, ports)
+			port_offload_cap_display(i);
 }
 
 cmdline_parse_token_string_t cmd_showportall_show =
@@ -5821,13 +5824,14 @@  cmdline_parse_token_string_t cmd_showportall_port =
 	TOKEN_STRING_INITIALIZER(struct cmd_showportall_result, port, "port");
 cmdline_parse_token_string_t cmd_showportall_what =
 	TOKEN_STRING_INITIALIZER(struct cmd_showportall_result, what,
-				 "info#stats#xstats#fdir#stat_qmap#dcb_tc");
+				 "info#stats#xstats#fdir#stat_qmap#dcb_tc#cap");
 cmdline_parse_token_string_t cmd_showportall_all =
 	TOKEN_STRING_INITIALIZER(struct cmd_showportall_result, all, "all");
 cmdline_parse_inst_t cmd_showportall = {
 	.f = cmd_showportall_parsed,
 	.data = NULL,
-	.help_str = "show|clear port info|stats|xstats|fdir|stat_qmap|dcb_tc all",
+	.help_str = "show|clear port"
+	"info|stats|xstats|fdir|stat_qmap|dcb_tc|cap all",
 	.tokens = {
 		(void *)&cmd_showportall_show,
 		(void *)&cmd_showportall_port,
@@ -5867,6 +5871,8 @@  static void cmd_showport_parsed(void *parsed_result,
 		nic_stats_mapping_display(res->portnum);
 	else if (!strcmp(res->what, "dcb_tc"))
 		port_dcb_info_display(res->portnum);
+	else if (!strcmp(res->what, "cap"))
+		port_offload_cap_display(res->portnum);
 }
 
 cmdline_parse_token_string_t cmd_showport_show =
@@ -5876,14 +5882,15 @@  cmdline_parse_token_string_t cmd_showport_port =
 	TOKEN_STRING_INITIALIZER(struct cmd_showport_result, port, "port");
 cmdline_parse_token_string_t cmd_showport_what =
 	TOKEN_STRING_INITIALIZER(struct cmd_showport_result, what,
-				 "info#stats#xstats#fdir#stat_qmap#dcb_tc");
+				 "info#stats#xstats#fdir#stat_qmap#dcb_tc#cap");
 cmdline_parse_token_num_t cmd_showport_portnum =
 	TOKEN_NUM_INITIALIZER(struct cmd_showport_result, portnum, UINT8);
 
 cmdline_parse_inst_t cmd_showport = {
 	.f = cmd_showport_parsed,
 	.data = NULL,
-	.help_str = "show|clear port info|stats|xstats|fdir|stat_qmap|dcb_tc "
+	.help_str = "show|clear port"
+		"info|stats|xstats|fdir|stat_qmap|dcb_tc|cap "
 		"<port_id>",
 	.tokens = {
 		(void *)&cmd_showport_show,
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 617e6d4..8a2ef56 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -542,6 +542,181 @@  port_infos_display(portid_t port_id)
 		dev_info.tx_desc_lim.nb_min);
 	printf("TXDs number alignment: %hu\n", dev_info.tx_desc_lim.nb_align);
 }
+void
+port_offload_cap_display(portid_t port_id)
+{
+	struct rte_eth_dev *dev;
+	struct rte_eth_dev_info dev_info;
+	static const char *info_border = "************";
+
+	if (port_id_is_invalid(port_id, ENABLED_WARN))
+		return;
+
+	dev = &rte_eth_devices[port_id];
+	rte_eth_dev_info_get(port_id, &dev_info);
+
+	printf("\n%s Port %d supported offload features: %s\n",
+		info_border, port_id, info_border);
+
+	if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_VLAN_STRIP) {
+		printf("VLAN stripped:                 ");
+		if (dev->data->dev_conf.rxmode.hw_vlan_strip)
+			printf("on\n");
+		else
+			printf("off\n");
+	}
+
+	if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_QINQ_STRIP) {
+		printf("Double VLANs stripped:         ");
+		if (dev->data->dev_conf.rxmode.hw_vlan_extend)
+			printf("on\n");
+		else
+			printf("off\n");
+	}
+
+	if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_IPV4_CKSUM) {
+		printf("RX IPv4 checksum:              ");
+		if (dev->data->dev_conf.rxmode.hw_ip_checksum)
+			printf("on\n");
+		else
+			printf("off\n");
+	}
+
+	if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_UDP_CKSUM) {
+		printf("RX UDP checksum:               ");
+		if (dev->data->dev_conf.rxmode.hw_ip_checksum)
+			printf("on\n");
+		else
+			printf("off\n");
+	}
+
+	if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_TCP_CKSUM) {
+		printf("RX TCP checksum:               ");
+		if (dev->data->dev_conf.rxmode.hw_ip_checksum)
+			printf("on\n");
+		else
+			printf("off\n");
+	}
+
+	if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM)
+		printf("RX Outer IPv4 checksum:        ");
+
+	if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_TCP_LRO) {
+		printf("Large receive offload:         ");
+		if (dev->data->dev_conf.rxmode.enable_lro)
+			printf("on\n");
+		else
+			printf("off\n");
+	}
+
+	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_VLAN_INSERT) {
+		printf("VLAN insert:                   ");
+		if (ports[port_id].tx_ol_flags &
+		    TESTPMD_TX_OFFLOAD_INSERT_VLAN)
+			printf("on\n");
+		else
+			printf("off\n");
+	}
+
+	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_QINQ_INSERT) {
+		printf("Double VLANs insert:           ");
+		if (ports[port_id].tx_ol_flags &
+		    TESTPMD_TX_OFFLOAD_INSERT_QINQ)
+			printf("on\n");
+		else
+			printf("off\n");
+	}
+
+	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_IPV4_CKSUM) {
+		printf("TX IPv4 checksum:              ");
+		if (ports[port_id].tx_ol_flags & TESTPMD_TX_OFFLOAD_IP_CKSUM)
+			printf("on\n");
+		else
+			printf("off\n");
+	}
+
+	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_UDP_CKSUM) {
+		printf("TX UDP checksum:               ");
+		if (ports[port_id].tx_ol_flags & TESTPMD_TX_OFFLOAD_UDP_CKSUM)
+			printf("on\n");
+		else
+			printf("off\n");
+	}
+
+	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_TCP_CKSUM) {
+		printf("TX TCP checksum:               ");
+		if (ports[port_id].tx_ol_flags & TESTPMD_TX_OFFLOAD_TCP_CKSUM)
+			printf("on\n");
+		else
+			printf("off\n");
+	}
+
+	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_SCTP_CKSUM) {
+		printf("TX SCTP checksum:              ");
+		if (ports[port_id].tx_ol_flags & TESTPMD_TX_OFFLOAD_SCTP_CKSUM)
+			printf("on\n");
+		else
+			printf("off\n");
+	}
+
+	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM) {
+		printf("TX Outer IPv4 checksum:        ");
+		if (ports[port_id].tx_ol_flags &
+		    TESTPMD_TX_OFFLOAD_OUTER_IP_CKSUM)
+			printf("on\n");
+		else
+			printf("off\n");
+	}
+
+	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_TCP_TSO) {
+		printf("TX TCP segmentation:           ");
+		if (ports[port_id].tso_segsz != 0)
+			printf("on\n");
+		else
+			printf("off\n");
+	}
+
+	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_UDP_TSO) {
+		printf("TX UDP segmentation:           ");
+		if (ports[port_id].tso_segsz != 0)
+			printf("on\n");
+		else
+			printf("off\n");
+	}
+
+	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_VXLAN_TNL_TSO) {
+		printf("TSO for VXLAN tunnel packet:   ");
+		if (ports[port_id].tunnel_tso_segsz)
+			printf("on\n");
+		else
+			printf("off\n");
+	}
+
+	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_GRE_TNL_TSO) {
+		printf("TSO for GRE tunnel packet:     ");
+		if (ports[port_id].tunnel_tso_segsz)
+			printf("on\n");
+		else
+			printf("off\n");
+	}
+
+	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_IPIP_TNL_TSO) {
+		printf("TSO for IPIP tunnel packet:    ");
+		if (ports[port_id].tunnel_tso_segsz)
+			printf("on\n");
+		else
+			printf("off\n");
+	}
+
+	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_GENEVE_TNL_TSO) {
+		printf("TSO for GENEVE tunnel packet:  ");
+		if (ports[port_id].tunnel_tso_segsz)
+			printf("on\n");
+		else
+			printf("off\n");
+	}
+
+}
 
 int
 port_id_is_invalid(portid_t port_id, enum print_warning warning)
diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
index 22ce2d6..8b2374a 100644
--- a/app/test-pmd/testpmd.h
+++ b/app/test-pmd/testpmd.h
@@ -498,6 +498,7 @@  void nic_xstats_display(portid_t port_id);
 void nic_xstats_clear(portid_t port_id);
 void nic_stats_mapping_display(portid_t port_id);
 void port_infos_display(portid_t port_id);
+void port_offload_cap_display(portid_t port_id);
 void rx_queue_infos_display(portid_t port_idi, uint16_t queue_id);
 void tx_queue_infos_display(portid_t port_idi, uint16_t queue_id);
 void fwd_lcores_config_display(void);
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index c611dc5..0e49d98 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -51,10 +51,10 @@  If you type a partial command and hit ``<TAB>`` you get a list of the available
 
    testpmd> show port <TAB>
 
-       info [Mul-choice STRING]: show|clear port info|stats|xstats|fdir|stat_qmap|dcb_tc X
-       info [Mul-choice STRING]: show|clear port info|stats|xstats|fdir|stat_qmap|dcb_tc all
-       stats [Mul-choice STRING]: show|clear port info|stats|xstats|fdir|stat_qmap|dcb_tc X
-       stats [Mul-choice STRING]: show|clear port info|stats|xstats|fdir|stat_qmap|dcb_tc all
+       info [Mul-choice STRING]: show|clear port info|stats|xstats|fdir|stat_qmap|dcb_tc|cap X
+       info [Mul-choice STRING]: show|clear port info|stats|xstats|fdir|stat_qmap|dcb_tc|cap all
+       stats [Mul-choice STRING]: show|clear port info|stats|xstats|fdir|stat_qmap|dcb_tc|cap X
+       stats [Mul-choice STRING]: show|clear port info|stats|xstats|fdir|stat_qmap|dcb_tc|cap all
        ...
 
 
@@ -131,7 +131,7 @@  show port
 
 Display information for a given port or all ports::
 
-   testpmd> show port (info|stats|xstats|fdir|stat_qmap|dcb_tc) (port_id|all)
+   testpmd> show port (info|stats|xstats|fdir|stat_qmap|dcb_tc|cap) (port_id|all)
 
 The available information categories are:
 
@@ -147,6 +147,8 @@  The available information categories are:
 
 * ``dcb_tc``: DCB information such as TC mapping.
 
+* ``cap``: Supported offload capabilities.
+
 For example:
 
 .. code-block:: console