DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] app/testpmd: fix failing to enable SW checksum calculation
@ 2018-01-25  2:13 Jiayu Hu
  2018-01-25  2:58 ` Lu, Wenzhuo
  2018-01-25  6:54 ` Shahaf Shuler
  0 siblings, 2 replies; 6+ messages in thread
From: Jiayu Hu @ 2018-01-25  2:13 UTC (permalink / raw)
  To: dev; +Cc: shahafs, wenzhuo.lu, lei.a.yao, Jiayu Hu

In current design, we can't enable SW checksum calculation
for the devices which don't have checksum offloading abilities
via the command "csum set ip|tcp|udp|sctp|outer-ip sw <port_id>".
But SW checksum calculation shouldn't depend on HW offloading
abilities. This patch is to fix this issue.

Fixes: 3926dd2b6668 ("app/testpmd: enforce offload capabilities check")
Signed-off-by: Jiayu Hu <jiayu.hu@intel.com>
---
 app/test-pmd/cmdline.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 9f12c0f..a2db9b7 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -3706,40 +3706,40 @@ cmd_csum_parsed(void *parsed_result,
 			hw = 1;
 
 		if (!strcmp(res->proto, "ip")) {
-			if (dev_info.tx_offload_capa &
-						DEV_TX_OFFLOAD_IPV4_CKSUM) {
+			if (hw == 0 || (dev_info.tx_offload_capa &
+						DEV_TX_OFFLOAD_IPV4_CKSUM)) {
 				csum_offloads |= DEV_TX_OFFLOAD_IPV4_CKSUM;
 			} else {
 				printf("IP checksum offload is not supported "
 				       "by port %u\n", res->port_id);
 			}
 		} else if (!strcmp(res->proto, "udp")) {
-			if (dev_info.tx_offload_capa &
-						DEV_TX_OFFLOAD_UDP_CKSUM) {
+			if (hw == 0 || (dev_info.tx_offload_capa &
+						DEV_TX_OFFLOAD_UDP_CKSUM)) {
 				csum_offloads |= DEV_TX_OFFLOAD_UDP_CKSUM;
 			} else {
 				printf("UDP checksum offload is not supported "
 				       "by port %u\n", res->port_id);
 			}
 		} else if (!strcmp(res->proto, "tcp")) {
-			if (dev_info.tx_offload_capa &
-						DEV_TX_OFFLOAD_TCP_CKSUM) {
+			if (hw == 0 || (dev_info.tx_offload_capa &
+						DEV_TX_OFFLOAD_TCP_CKSUM)) {
 				csum_offloads |= DEV_TX_OFFLOAD_TCP_CKSUM;
 			} else {
 				printf("TCP checksum offload is not supported "
 				       "by port %u\n", res->port_id);
 			}
 		} else if (!strcmp(res->proto, "sctp")) {
-			if (dev_info.tx_offload_capa &
-						DEV_TX_OFFLOAD_SCTP_CKSUM) {
+			if (hw == 0 || (dev_info.tx_offload_capa &
+						DEV_TX_OFFLOAD_SCTP_CKSUM)) {
 				csum_offloads |= DEV_TX_OFFLOAD_SCTP_CKSUM;
 			} else {
 				printf("SCTP checksum offload is not supported "
 				       "by port %u\n", res->port_id);
 			}
 		} else if (!strcmp(res->proto, "outer-ip")) {
-			if (dev_info.tx_offload_capa &
-					DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM) {
+			if (hw == 0 || (dev_info.tx_offload_capa &
+					DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM)) {
 				csum_offloads |=
 						DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM;
 			} else {
-- 
2.7.4

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

* Re: [dpdk-dev] [PATCH] app/testpmd: fix failing to enable SW checksum calculation
  2018-01-25  2:13 [dpdk-dev] [PATCH] app/testpmd: fix failing to enable SW checksum calculation Jiayu Hu
@ 2018-01-25  2:58 ` Lu, Wenzhuo
  2018-01-25  3:04   ` Hu, Jiayu
  2018-01-25  3:06   ` Hu, Jiayu
  2018-01-25  6:54 ` Shahaf Shuler
  1 sibling, 2 replies; 6+ messages in thread
From: Lu, Wenzhuo @ 2018-01-25  2:58 UTC (permalink / raw)
  To: Hu, Jiayu, dev; +Cc: shahafs, Yao, Lei A

Hi Jiayu,


> -----Original Message-----
> From: Hu, Jiayu
> Sent: Thursday, January 25, 2018 10:14 AM
> To: dev@dpdk.org
> Cc: shahafs@mellanox.com; Lu, Wenzhuo <wenzhuo.lu@intel.com>; Yao, Lei
> A <lei.a.yao@intel.com>; Hu, Jiayu <jiayu.hu@intel.com>
> Subject: [PATCH] app/testpmd: fix failing to enable SW checksum calculation
> 
> In current design, we can't enable SW checksum calculation for the devices
> which don't have checksum offloading abilities via the command "csum set
> ip|tcp|udp|sctp|outer-ip sw <port_id>".
Confused, you mean it's an issue or the expected behavior?

> But SW checksum calculation shouldn't depend on HW offloading abilities.
> This patch is to fix this issue.
> 
> Fixes: 3926dd2b6668 ("app/testpmd: enforce offload capabilities check")
> Signed-off-by: Jiayu Hu <jiayu.hu@intel.com>
> ---
>  app/test-pmd/cmdline.c | 20 ++++++++++----------
>  1 file changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index
> 9f12c0f..a2db9b7 100644
> --- a/app/test-pmd/cmdline.c
> +++ b/app/test-pmd/cmdline.c
> @@ -3706,40 +3706,40 @@ cmd_csum_parsed(void *parsed_result,
>  			hw = 1;
> 
>  		if (!strcmp(res->proto, "ip")) {
> -			if (dev_info.tx_offload_capa &
> -
> 	DEV_TX_OFFLOAD_IPV4_CKSUM) {
> +			if (hw == 0 || (dev_info.tx_offload_capa &
You mean SW can support the capability anyway, not need to check anything, right?

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

* Re: [dpdk-dev] [PATCH] app/testpmd: fix failing to enable SW checksum calculation
  2018-01-25  2:58 ` Lu, Wenzhuo
@ 2018-01-25  3:04   ` Hu, Jiayu
  2018-01-25  3:06   ` Hu, Jiayu
  1 sibling, 0 replies; 6+ messages in thread
From: Hu, Jiayu @ 2018-01-25  3:04 UTC (permalink / raw)
  To: Lu, Wenzhuo, dev; +Cc: shahafs, Yao, Lei A

Hi Wenzhuo,

> -----Original Message-----
> From: Lu, Wenzhuo
> Sent: Thursday, January 25, 2018 10:58 AM
> To: Hu, Jiayu <jiayu.hu@intel.com>; dev@dpdk.org
> Cc: shahafs@mellanox.com; Yao, Lei A <lei.a.yao@intel.com>
> Subject: RE: [PATCH] app/testpmd: fix failing to enable SW checksum
> calculation
> 
> Hi Jiayu,
> 
> 
> > -----Original Message-----
> > From: Hu, Jiayu
> > Sent: Thursday, January 25, 2018 10:14 AM
> > To: dev@dpdk.org
> > Cc: shahafs@mellanox.com; Lu, Wenzhuo <wenzhuo.lu@intel.com>; Yao,
> Lei
> > A <lei.a.yao@intel.com>; Hu, Jiayu <jiayu.hu@intel.com>
> > Subject: [PATCH] app/testpmd: fix failing to enable SW checksum
> calculation
> >
> > In current design, we can't enable SW checksum calculation for the devices
> > which don't have checksum offloading abilities via the command "csum set
> > ip|tcp|udp|sctp|outer-ip sw <port_id>".
> Confused, you mean it's an issue or the expected behavior?
> 
> > But SW checksum calculation shouldn't depend on HW offloading abilities.
> > This patch is to fix this issue.
> >
> > Fixes: 3926dd2b6668 ("app/testpmd: enforce offload capabilities check")
> > Signed-off-by: Jiayu Hu <jiayu.hu@intel.com>
> > ---
> >  app/test-pmd/cmdline.c | 20 ++++++++++----------
> >  1 file changed, 10 insertions(+), 10 deletions(-)
> >
> > diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index
> > 9f12c0f..a2db9b7 100644
> > --- a/app/test-pmd/cmdline.c
> > +++ b/app/test-pmd/cmdline.c
> > @@ -3706,40 +3706,40 @@ cmd_csum_parsed(void *parsed_result,
> >  			hw = 1;
> >
> >  		if (!strcmp(res->proto, "ip")) {
> > -			if (dev_info.tx_offload_capa &
> > -
> > 	DEV_TX_OFFLOAD_IPV4_CKSUM) {
> > +			if (hw == 0 || (dev_info.tx_offload_capa &
> You mean SW can support the capability anyway, not need to check anything,
> right?
Yes, it's the csum forwarding engine to calculate checksums. This SW ability should
supports all devices.

Thanks,
Jiayu

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

* Re: [dpdk-dev] [PATCH] app/testpmd: fix failing to enable SW checksum calculation
  2018-01-25  2:58 ` Lu, Wenzhuo
  2018-01-25  3:04   ` Hu, Jiayu
@ 2018-01-25  3:06   ` Hu, Jiayu
  1 sibling, 0 replies; 6+ messages in thread
From: Hu, Jiayu @ 2018-01-25  3:06 UTC (permalink / raw)
  To: Lu, Wenzhuo, dev; +Cc: shahafs, Yao, Lei A



> -----Original Message-----
> From: Lu, Wenzhuo
> Sent: Thursday, January 25, 2018 10:58 AM
> To: Hu, Jiayu <jiayu.hu@intel.com>; dev@dpdk.org
> Cc: shahafs@mellanox.com; Yao, Lei A <lei.a.yao@intel.com>
> Subject: RE: [PATCH] app/testpmd: fix failing to enable SW checksum
> calculation
> 
> Hi Jiayu,
> 
> 
> > -----Original Message-----
> > From: Hu, Jiayu
> > Sent: Thursday, January 25, 2018 10:14 AM
> > To: dev@dpdk.org
> > Cc: shahafs@mellanox.com; Lu, Wenzhuo <wenzhuo.lu@intel.com>; Yao,
> Lei
> > A <lei.a.yao@intel.com>; Hu, Jiayu <jiayu.hu@intel.com>
> > Subject: [PATCH] app/testpmd: fix failing to enable SW checksum
> calculation
> >
> > In current design, we can't enable SW checksum calculation for the devices
> > which don't have checksum offloading abilities via the command "csum set
> > ip|tcp|udp|sctp|outer-ip sw <port_id>".
> Confused, you mean it's an issue or the expected behavior?

It's an issue. SW checksum calculation should support all devices.

> 
> > But SW checksum calculation shouldn't depend on HW offloading abilities.
> > This patch is to fix this issue.
> >
> > Fixes: 3926dd2b6668 ("app/testpmd: enforce offload capabilities check")
> > Signed-off-by: Jiayu Hu <jiayu.hu@intel.com>
> > ---
> >  app/test-pmd/cmdline.c | 20 ++++++++++----------
> >  1 file changed, 10 insertions(+), 10 deletions(-)
> >
> > diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index
> > 9f12c0f..a2db9b7 100644
> > --- a/app/test-pmd/cmdline.c
> > +++ b/app/test-pmd/cmdline.c
> > @@ -3706,40 +3706,40 @@ cmd_csum_parsed(void *parsed_result,
> >  			hw = 1;
> >
> >  		if (!strcmp(res->proto, "ip")) {
> > -			if (dev_info.tx_offload_capa &
> > -
> > 	DEV_TX_OFFLOAD_IPV4_CKSUM) {
> > +			if (hw == 0 || (dev_info.tx_offload_capa &
> You mean SW can support the capability anyway, not need to check anything,
> right?

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

* Re: [dpdk-dev] [PATCH] app/testpmd: fix failing to enable SW checksum calculation
  2018-01-25  2:13 [dpdk-dev] [PATCH] app/testpmd: fix failing to enable SW checksum calculation Jiayu Hu
  2018-01-25  2:58 ` Lu, Wenzhuo
@ 2018-01-25  6:54 ` Shahaf Shuler
  2018-01-31 22:34   ` Thomas Monjalon
  1 sibling, 1 reply; 6+ messages in thread
From: Shahaf Shuler @ 2018-01-25  6:54 UTC (permalink / raw)
  To: Jiayu Hu, dev; +Cc: wenzhuo.lu, lei.a.yao

Hi Jiayu Hu,

Good fix, thanks.

Thursday, January 25, 2018 4:14 AM, Jiayu Hu:
> In current design, we can't enable SW checksum calculation for the devices
> which don't have checksum offloading abilities via the command "csum set
> ip|tcp|udp|sctp|outer-ip sw <port_id>".
> But SW checksum calculation shouldn't depend on HW offloading abilities.
> This patch is to fix this issue.
> 
> Fixes: 3926dd2b6668 ("app/testpmd: enforce offload capabilities check")
> Signed-off-by: Jiayu Hu <jiayu.hu@intel.com>
> ---
>  app/test-pmd/cmdline.c | 20 ++++++++++----------
>  1 file changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index
> 9f12c0f..a2db9b7 100644
> --- a/app/test-pmd/cmdline.c
> +++ b/app/test-pmd/cmdline.c
> @@ -3706,40 +3706,40 @@ cmd_csum_parsed(void *parsed_result,
>  			hw = 1;
> 
>  		if (!strcmp(res->proto, "ip")) {
> -			if (dev_info.tx_offload_capa &
> -
> 	DEV_TX_OFFLOAD_IPV4_CKSUM) {
> +			if (hw == 0 || (dev_info.tx_offload_capa &
> +
> 	DEV_TX_OFFLOAD_IPV4_CKSUM)) {
>  				csum_offloads |=
> DEV_TX_OFFLOAD_IPV4_CKSUM;
>  			} else {
>  				printf("IP checksum offload is not supported
> "
>  				       "by port %u\n", res->port_id);
>  			}
>  		} else if (!strcmp(res->proto, "udp")) {
> -			if (dev_info.tx_offload_capa &
> -
> 	DEV_TX_OFFLOAD_UDP_CKSUM) {
> +			if (hw == 0 || (dev_info.tx_offload_capa &
> +
> 	DEV_TX_OFFLOAD_UDP_CKSUM)) {
>  				csum_offloads |=
> DEV_TX_OFFLOAD_UDP_CKSUM;
>  			} else {
>  				printf("UDP checksum offload is not
> supported "
>  				       "by port %u\n", res->port_id);
>  			}
>  		} else if (!strcmp(res->proto, "tcp")) {
> -			if (dev_info.tx_offload_capa &
> -
> 	DEV_TX_OFFLOAD_TCP_CKSUM) {
> +			if (hw == 0 || (dev_info.tx_offload_capa &
> +
> 	DEV_TX_OFFLOAD_TCP_CKSUM)) {
>  				csum_offloads |=
> DEV_TX_OFFLOAD_TCP_CKSUM;
>  			} else {
>  				printf("TCP checksum offload is not
> supported "
>  				       "by port %u\n", res->port_id);
>  			}
>  		} else if (!strcmp(res->proto, "sctp")) {
> -			if (dev_info.tx_offload_capa &
> -
> 	DEV_TX_OFFLOAD_SCTP_CKSUM) {
> +			if (hw == 0 || (dev_info.tx_offload_capa &
> +
> 	DEV_TX_OFFLOAD_SCTP_CKSUM)) {
>  				csum_offloads |=
> DEV_TX_OFFLOAD_SCTP_CKSUM;
>  			} else {
>  				printf("SCTP checksum offload is not
> supported "
>  				       "by port %u\n", res->port_id);
>  			}
>  		} else if (!strcmp(res->proto, "outer-ip")) {
> -			if (dev_info.tx_offload_capa &
> -
> 	DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM) {
> +			if (hw == 0 || (dev_info.tx_offload_capa &
> +
> 	DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM)) {
>  				csum_offloads |=
> 
> 	DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM;
>  			} else {

Reviewed-by: Shahaf Shuler <shahafs@mellanox.com>

> --
> 2.7.4

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

* Re: [dpdk-dev] [PATCH] app/testpmd: fix failing to enable SW checksum calculation
  2018-01-25  6:54 ` Shahaf Shuler
@ 2018-01-31 22:34   ` Thomas Monjalon
  0 siblings, 0 replies; 6+ messages in thread
From: Thomas Monjalon @ 2018-01-31 22:34 UTC (permalink / raw)
  To: Jiayu Hu; +Cc: dev, Shahaf Shuler, wenzhuo.lu, lei.a.yao

25/01/2018 07:54, Shahaf Shuler:
> Hi Jiayu Hu,
> 
> Good fix, thanks.
> 
> Thursday, January 25, 2018 4:14 AM, Jiayu Hu:
> > In current design, we can't enable SW checksum calculation for the devices
> > which don't have checksum offloading abilities via the command "csum set
> > ip|tcp|udp|sctp|outer-ip sw <port_id>".
> > But SW checksum calculation shouldn't depend on HW offloading abilities.
> > This patch is to fix this issue.
> > 
> > Fixes: 3926dd2b6668 ("app/testpmd: enforce offload capabilities check")
> > Signed-off-by: Jiayu Hu <jiayu.hu@intel.com>
> 
> Reviewed-by: Shahaf Shuler <shahafs@mellanox.com>

Applied, thanks

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

end of thread, other threads:[~2018-01-31 22:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-25  2:13 [dpdk-dev] [PATCH] app/testpmd: fix failing to enable SW checksum calculation Jiayu Hu
2018-01-25  2:58 ` Lu, Wenzhuo
2018-01-25  3:04   ` Hu, Jiayu
2018-01-25  3:06   ` Hu, Jiayu
2018-01-25  6:54 ` Shahaf Shuler
2018-01-31 22:34   ` Thomas Monjalon

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).