[1/4] ethdev: add SCTP Rx checksum offload support
diff mbox series

Message ID 20180913134707.23698-1-jerin.jacob@caviumnetworks.com
State Not Applicable, archived
Delegated to: Ferruh Yigit
Headers show
Series
  • [1/4] ethdev: add SCTP Rx checksum offload support
Related show

Checks

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

Commit Message

Jerin Jacob Sept. 13, 2018, 1:47 p.m. UTC
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
---
 app/test-pmd/config.c          | 9 +++++++++
 doc/guides/nics/features.rst   | 4 ++--
 lib/librte_ethdev/rte_ethdev.c | 1 +
 lib/librte_ethdev/rte_ethdev.h | 1 +
 4 files changed, 13 insertions(+), 2 deletions(-)

Comments

Ferruh Yigit Oct. 1, 2018, 1:45 p.m. UTC | #1
On 9/13/2018 2:47 PM, Jerin Jacob wrote:
> Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> ---
>  app/test-pmd/config.c          | 9 +++++++++
>  doc/guides/nics/features.rst   | 4 ++--
>  lib/librte_ethdev/rte_ethdev.c | 1 +
>  lib/librte_ethdev/rte_ethdev.h | 1 +
>  4 files changed, 13 insertions(+), 2 deletions(-)
> 
> diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
> index 14ccd6864..c4ed8d474 100644
> --- a/app/test-pmd/config.c
> +++ b/app/test-pmd/config.c
> @@ -576,6 +576,15 @@ port_offload_cap_display(portid_t port_id)
>  			printf("off\n");
>  	}
>  
> +	if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_SCTP_CKSUM) {
> +		printf("RX SCTP checksum:               ");

There is extra space in log, it doesn't align with other logs.
Ferruh Yigit Oct. 1, 2018, 1:46 p.m. UTC | #2
On 9/13/2018 2:47 PM, Jerin Jacob wrote:
> Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>

Overall set looks good to me, I put some comments on individual patches.

And can you please rebase on top of latest head?

Thanks,
ferruh
Jerin Jacob Oct. 1, 2018, 3:59 p.m. UTC | #3
-----Original Message-----
> Date: Mon, 1 Oct 2018 14:46:39 +0100
> From: Ferruh Yigit <ferruh.yigit@intel.com>
> To: Jerin Jacob <jerin.jacob@caviumnetworks.com>, Wenzhuo Lu
>  <wenzhuo.lu@intel.com>, Jingjing Wu <jingjing.wu@intel.com>, Bernard
>  Iremonger <bernard.iremonger@intel.com>, John McNamara
>  <john.mcnamara@intel.com>, Marko Kovacevic <marko.kovacevic@intel.com>,
>  Thomas Monjalon <thomas@monjalon.net>, Andrew Rybchenko
>  <arybchenko@solarflare.com>
> CC: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH 1/4] ethdev: add SCTP Rx checksum offload
>  support
> User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101
>  Thunderbird/52.9.1
> 
> 
> On 9/13/2018 2:47 PM, Jerin Jacob wrote:
> > Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> 
> Overall set looks good to me, I put some comments on individual patches.
> 
> And can you please rebase on top of latest head?

Sure.

Regarding space issue mentioned in other email in this thread.
It looks like similar space added in other offloads.
example: http://git.dpdk.org/dpdk/tree/app/test-pmd/config.c#n571

So, I expect no change in this patch other than rebase to latest head.
If not, let me know.

> 
> Thanks,
> ferruh
>
Ferruh Yigit Oct. 1, 2018, 4:11 p.m. UTC | #4
On 10/1/2018 4:59 PM, Jerin Jacob wrote:
> -----Original Message-----
>> Date: Mon, 1 Oct 2018 14:46:39 +0100
>> From: Ferruh Yigit <ferruh.yigit@intel.com>
>> To: Jerin Jacob <jerin.jacob@caviumnetworks.com>, Wenzhuo Lu
>>  <wenzhuo.lu@intel.com>, Jingjing Wu <jingjing.wu@intel.com>, Bernard
>>  Iremonger <bernard.iremonger@intel.com>, John McNamara
>>  <john.mcnamara@intel.com>, Marko Kovacevic <marko.kovacevic@intel.com>,
>>  Thomas Monjalon <thomas@monjalon.net>, Andrew Rybchenko
>>  <arybchenko@solarflare.com>
>> CC: dev@dpdk.org
>> Subject: Re: [dpdk-dev] [PATCH 1/4] ethdev: add SCTP Rx checksum offload
>>  support
>> User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101
>>  Thunderbird/52.9.1
>>
>>
>> On 9/13/2018 2:47 PM, Jerin Jacob wrote:
>>> Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
>>
>> Overall set looks good to me, I put some comments on individual patches.
>>
>> And can you please rebase on top of latest head?
> 
> Sure.
> 
> Regarding space issue mentioned in other email in this thread.
> It looks like similar space added in other offloads.
> example: http://git.dpdk.org/dpdk/tree/app/test-pmd/config.c#n571

Hi Jerin,

This is just detail, the alignment is broken in the output of the log, for
others on/off start from column 56, for this one it is 57, just delete a space
from printf please.

> 
> So, I expect no change in this patch other than rebase to latest head.
> If not, let me know.
> 
>>
>> Thanks,
>> ferruh
>>
Jerin Jacob Oct. 2, 2018, 8:53 a.m. UTC | #5
-----Original Message-----
> Date: Mon, 1 Oct 2018 17:11:50 +0100
> From: Ferruh Yigit <ferruh.yigit@intel.com>
> To: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> CC: Wenzhuo Lu <wenzhuo.lu@intel.com>, Jingjing Wu <jingjing.wu@intel.com>,
>  Bernard Iremonger <bernard.iremonger@intel.com>, John McNamara
>  <john.mcnamara@intel.com>, Marko Kovacevic <marko.kovacevic@intel.com>,
>  Thomas Monjalon <thomas@monjalon.net>, Andrew Rybchenko
>  <arybchenko@solarflare.com>, dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH 1/4] ethdev: add SCTP Rx checksum offload
>  support
> User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101
>  Thunderbird/52.9.1
> 
> On 10/1/2018 4:59 PM, Jerin Jacob wrote:
> > -----Original Message-----
> >> Date: Mon, 1 Oct 2018 14:46:39 +0100
> >> From: Ferruh Yigit <ferruh.yigit@intel.com>
> >> To: Jerin Jacob <jerin.jacob@caviumnetworks.com>, Wenzhuo Lu
> >>  <wenzhuo.lu@intel.com>, Jingjing Wu <jingjing.wu@intel.com>, Bernard
> >>  Iremonger <bernard.iremonger@intel.com>, John McNamara
> >>  <john.mcnamara@intel.com>, Marko Kovacevic <marko.kovacevic@intel.com>,
> >>  Thomas Monjalon <thomas@monjalon.net>, Andrew Rybchenko
> >>  <arybchenko@solarflare.com>
> >> CC: dev@dpdk.org
> >> Subject: Re: [dpdk-dev] [PATCH 1/4] ethdev: add SCTP Rx checksum offload
> >>  support
> >> User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101
> >>  Thunderbird/52.9.1
> >>
> >>
> >> On 9/13/2018 2:47 PM, Jerin Jacob wrote:
> >>> Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> >>
> >> Overall set looks good to me, I put some comments on individual patches.
> >>
> >> And can you please rebase on top of latest head?
> >
> > Sure.
> >
> > Regarding space issue mentioned in other email in this thread.
> > It looks like similar space added in other offloads.
> > example: http://git.dpdk.org/dpdk/tree/app/test-pmd/config.c#n571
> 
> Hi Jerin,
> 
> This is just detail, the alignment is broken in the output of the log, for
> others on/off start from column 56, for this one it is 57, just delete a space
> from printf please.

Sure Ferruh. Will add it in v2

> 
> >
> > So, I expect no change in this patch other than rebase to latest head.
> > If not, let me know.
> >
> >>
> >> Thanks,
> >> ferruh
> >>
>
Ferruh Yigit Oct. 2, 2018, 9:13 a.m. UTC | #6
On 10/1/2018 4:59 PM, Jerin Jacob wrote:
> -----Original Message-----
>> Date: Mon, 1 Oct 2018 14:46:39 +0100
>> From: Ferruh Yigit <ferruh.yigit@intel.com>
>> To: Jerin Jacob <jerin.jacob@caviumnetworks.com>, Wenzhuo Lu
>>  <wenzhuo.lu@intel.com>, Jingjing Wu <jingjing.wu@intel.com>, Bernard
>>  Iremonger <bernard.iremonger@intel.com>, John McNamara
>>  <john.mcnamara@intel.com>, Marko Kovacevic <marko.kovacevic@intel.com>,
>>  Thomas Monjalon <thomas@monjalon.net>, Andrew Rybchenko
>>  <arybchenko@solarflare.com>
>> CC: dev@dpdk.org
>> Subject: Re: [dpdk-dev] [PATCH 1/4] ethdev: add SCTP Rx checksum offload
>>  support
>> User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101
>>  Thunderbird/52.9.1
>>
>>
>> On 9/13/2018 2:47 PM, Jerin Jacob wrote:
>>> Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
>>
>> Overall set looks good to me, I put some comments on individual patches.
>>
>> And can you please rebase on top of latest head?
> 
> Sure.
> 
> Regarding space issue mentioned in other email in this thread.
> It looks like similar space added in other offloads.
> example: http://git.dpdk.org/dpdk/tree/app/test-pmd/config.c#n571
> 
> So, I expect no change in this patch other than rebase to latest head.
> If not, let me know.

As commented to the patch, can you also check "csum show", "csum set" functions
in testpmd, I think they are affected and need to be updated with your patch.

Patch
diff mbox series

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 14ccd6864..c4ed8d474 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -576,6 +576,15 @@  port_offload_cap_display(portid_t port_id)
 			printf("off\n");
 	}
 
+	if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_SCTP_CKSUM) {
+		printf("RX SCTP checksum:               ");
+		if (ports[port_id].dev_conf.rxmode.offloads &
+		    DEV_RX_OFFLOAD_SCTP_CKSUM)
+			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 (ports[port_id].dev_conf.rxmode.offloads &
diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst
index cddc877d4..a98356a16 100644
--- a/doc/guides/nics/features.rst
+++ b/doc/guides/nics/features.rst
@@ -575,7 +575,7 @@  L4 checksum offload
 
 Supports L4 checksum offload.
 
-* **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_UDP_CKSUM,DEV_RX_OFFLOAD_TCP_CKSUM``.
+* **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_UDP_CKSUM,DEV_RX_OFFLOAD_TCP_CKSUM,DEV_RX_OFFLOAD_SCTP_CKSUM``.
 * **[uses]     rte_eth_txconf,rte_eth_txmode**: ``offloads:DEV_TX_OFFLOAD_UDP_CKSUM,DEV_TX_OFFLOAD_TCP_CKSUM,DEV_TX_OFFLOAD_SCTP_CKSUM``.
 * **[uses]     mbuf**: ``mbuf.ol_flags:PKT_TX_IPV4`` | ``PKT_TX_IPV6``,
   ``mbuf.ol_flags:PKT_TX_L4_NO_CKSUM`` | ``PKT_TX_TCP_CKSUM`` |
@@ -583,7 +583,7 @@  Supports L4 checksum offload.
 * **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_L4_CKSUM_UNKNOWN`` |
   ``PKT_RX_L4_CKSUM_BAD`` | ``PKT_RX_L4_CKSUM_GOOD`` |
   ``PKT_RX_L4_CKSUM_NONE``.
-* **[provides] rte_eth_dev_info**: ``rx_offload_capa,rx_queue_offload_capa:DEV_RX_OFFLOAD_UDP_CKSUM,DEV_RX_OFFLOAD_TCP_CKSUM``,
+* **[provides] rte_eth_dev_info**: ``rx_offload_capa,rx_queue_offload_capa:DEV_RX_OFFLOAD_UDP_CKSUM,DEV_RX_OFFLOAD_TCP_CKSUM,DEV_RX_OFFLOAD_SCTP_CKSUM``,
   ``tx_offload_capa,tx_queue_offload_capa:DEV_TX_OFFLOAD_UDP_CKSUM,DEV_TX_OFFLOAD_TCP_CKSUM,DEV_TX_OFFLOAD_SCTP_CKSUM``.
 
 .. _nic_features_hw_timestamp:
diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 4c3202505..d91870e90 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -127,6 +127,7 @@  static const struct {
 	RTE_RX_OFFLOAD_BIT2STR(TIMESTAMP),
 	RTE_RX_OFFLOAD_BIT2STR(SECURITY),
 	RTE_RX_OFFLOAD_BIT2STR(KEEP_CRC),
+	RTE_RX_OFFLOAD_BIT2STR(SCTP_CKSUM),
 };
 
 #undef RTE_RX_OFFLOAD_BIT2STR
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index 7070e9ab4..adbe936a4 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -900,6 +900,7 @@  struct rte_eth_conf {
  * No DEV_RX_OFFLOAD_CRC_STRIP flag means keep CRC
  */
 #define DEV_RX_OFFLOAD_KEEP_CRC		0x00010000
+#define DEV_RX_OFFLOAD_SCTP_CKSUM	0x00020000
 #define DEV_RX_OFFLOAD_CHECKSUM (DEV_RX_OFFLOAD_IPV4_CKSUM | \
 				 DEV_RX_OFFLOAD_UDP_CKSUM | \
 				 DEV_RX_OFFLOAD_TCP_CKSUM)