dev.dpdk.org archive mirror
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
To: Olivier Matz <olivier.matz-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
Cc: jigsaw-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	dev-VfR2kkLFssw@public.gmane.org
Subject: Re: [PATCH 04/12] mbuf: add help about TX checksum flags
Date: Mon, 10 Nov 2014 17:10:59 +0000	[thread overview]
Message-ID: <20141110171059.GD10776@bricha3-MOBL3> (raw)
In-Reply-To: <1415635166-1364-5-git-send-email-olivier.matz-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>

On Mon, Nov 10, 2014 at 04:59:18PM +0100, Olivier Matz wrote:
> Describe how to use hardware checksum API.
> 
> Signed-off-by: Olivier Matz <olivier.matz-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>

Acked-by: Bruce Richardson <bruce.richardson-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

> ---
>  lib/librte_mbuf/rte_mbuf.h | 25 +++++++++++++++++--------
>  1 file changed, 17 insertions(+), 8 deletions(-)
> 
> diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
> index be15168..96e322b 100644
> --- a/lib/librte_mbuf/rte_mbuf.h
> +++ b/lib/librte_mbuf/rte_mbuf.h
> @@ -95,19 +95,28 @@ extern "C" {
>  #define PKT_RX_TUNNEL_IPV6_HDR (1ULL << 12) /**< RX tunnel packet with IPv6 header. */
>  
>  #define PKT_TX_VLAN_PKT      (1ULL << 55) /**< TX packet is a 802.1q VLAN packet. */
> -#define PKT_TX_IP_CKSUM      (1ULL << 54) /**< IP cksum of TX pkt. computed by NIC. */
> +
> +/**
> + * Enable hardware computation of IP cksum. To use it:
> + *  - fill l2_len and l3_len in mbuf
> + *  - set the flags PKT_TX_IP_CKSUM
> + *  - set the ip checksum to 0 in IP header
> + */
> +#define PKT_TX_IP_CKSUM      (1ULL << 54)
>  #define PKT_TX_IPV4_CSUM     PKT_TX_IP_CKSUM /**< Alias of PKT_TX_IP_CKSUM. */
>  #define PKT_TX_IPV4          PKT_RX_IPV4_HDR /**< IPv4 with no IP checksum offload. */
>  #define PKT_TX_IPV6          PKT_RX_IPV6_HDR /**< IPv6 packet */
>  
> -/*
> - * Bits 52+53 used for L4 packet type with checksum enabled.
> - *     00: Reserved
> - *     01: TCP checksum
> - *     10: SCTP checksum
> - *     11: UDP checksum
> +/**
> + * Bits 52+53 used for L4 packet type with checksum enabled: 00: Reserved,
> + * 01: TCP checksum, 10: SCTP checksum, 11: UDP checksum. To use hardware
> + * L4 checksum offload, the user needs to:
> + *  - fill l2_len and l3_len in mbuf
> + *  - set the flags PKT_TX_TCP_CKSUM, PKT_TX_SCTP_CKSUM or PKT_TX_UDP_CKSUM
> + *  - calculate the pseudo header checksum and set it in the L4 header (only
> + *    for TCP or UDP). For SCTP, set the crc field to 0.
>   */
> -#define PKT_TX_L4_NO_CKSUM   (0ULL << 52) /**< Disable L4 cksum of TX pkt. */
> +#define PKT_TX_L4_NO_CKSUM   (0ULL << 52) /* Disable L4 cksum of TX pkt. */
>  #define PKT_TX_TCP_CKSUM     (1ULL << 52) /**< TCP cksum of TX pkt. computed by NIC. */
>  #define PKT_TX_SCTP_CKSUM    (2ULL << 52) /**< SCTP cksum of TX pkt. computed by NIC. */
>  #define PKT_TX_UDP_CKSUM     (3ULL << 52) /**< UDP cksum of TX pkt. computed by NIC. */
> -- 
> 2.1.0
> 

  parent reply	other threads:[~2014-11-10 17:10 UTC|newest]

Thread overview: 112+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-10 15:59 [PATCH 00/12] add TSO support Olivier Matz
     [not found] ` <1415635166-1364-1-git-send-email-olivier.matz-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
2014-11-10 15:59   ` [PATCH 01/12] igb/ixgbe: fix IP checksum calculation Olivier Matz
2014-11-10 15:59   ` [PATCH 02/12] ixgbe: fix remaining pkt_flags variable size to 64 bits Olivier Matz
     [not found]     ` <1415635166-1364-3-git-send-email-olivier.matz-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
2014-11-10 16:59       ` Bruce Richardson
2014-11-10 15:59   ` [PATCH 03/12] mbuf: move vxlan_cksum flag definition at the proper place Olivier Matz
     [not found]     ` <1415635166-1364-4-git-send-email-olivier.matz-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
2014-11-10 17:09       ` Bruce Richardson
2014-11-10 15:59   ` [PATCH 04/12] mbuf: add help about TX checksum flags Olivier Matz
     [not found]     ` <1415635166-1364-5-git-send-email-olivier.matz-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
2014-11-10 17:10       ` Bruce Richardson [this message]
2014-11-10 15:59   ` [PATCH 05/12] mbuf: remove too specific PKT_TX_OFFLOAD_MASK definition Olivier Matz
     [not found]     ` <1415635166-1364-6-git-send-email-olivier.matz-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
2014-11-10 17:14       ` Bruce Richardson
2014-11-10 20:59         ` Olivier MATZ
2014-11-10 15:59   ` [PATCH 06/12] mbuf: add functions to get the name of an ol_flag Olivier Matz
     [not found]     ` <1415635166-1364-7-git-send-email-olivier.matz-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
2014-11-10 17:29       ` Bruce Richardson
2014-11-10 20:54         ` Olivier MATZ
2014-11-12 17:21         ` Ananyev, Konstantin
     [not found]           ` <2601191342CEEE43887BDE71AB977258213A41C6-kPTMFJFq+rEu0RiL9chJVbfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-11-12 17:44             ` Olivier MATZ
2014-11-10 15:59   ` [PATCH 07/12] mbuf: generic support for TCP segmentation offload Olivier Matz
     [not found]     ` <1415635166-1364-8-git-send-email-olivier.matz-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
2014-11-11  3:17       ` Liu, Jijiang
2014-11-12 13:09       ` Ananyev, Konstantin
2014-11-10 15:59   ` [PATCH 08/12] ixgbe: support " Olivier Matz
2014-11-10 15:59   ` [PATCH 09/12] testpmd: fix use of offload flags in testpmd Olivier Matz
2014-11-10 15:59   ` [PATCH 10/12] testpmd: rework csum forward engine Olivier Matz
     [not found]     ` <1415635166-1364-11-git-send-email-olivier.matz-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
2014-11-11  8:35       ` Liu, Jijiang
     [not found]         ` <1ED644BD7E0A5F4091CF203DAFB8E4CC01D8F82C-0J0gbvR4kThpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-11-11  9:55           ` Olivier MATZ
2014-11-10 15:59   ` [PATCH 11/12] testpmd: support TSO in " Olivier Matz
2014-11-10 15:59   ` [PATCH 12/12] testpmd: add a verbose mode " Olivier Matz
2014-11-11  9:21   ` [PATCH 00/12] add TSO support Olivier MATZ
     [not found]     ` <5461D50B.6050201-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
2014-11-11  9:48       ` Olivier MATZ
2014-11-14 17:03   ` [PATCH v2 00/13] " Olivier Matz
     [not found]     ` <1415984609-2484-1-git-send-email-olivier.matz-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
2014-11-14 17:03       ` [PATCH v2 01/13] igb/ixgbe: fix IP checksum calculation Olivier Matz
2014-11-14 17:03       ` [PATCH v2 02/13] ixgbe: fix remaining pkt_flags variable size to 64 bits Olivier Matz
     [not found]         ` <1415984609-2484-3-git-send-email-olivier.matz-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
2014-11-17 16:47           ` Walukiewicz, Miroslaw
     [not found]             ` <7C4248CAE043B144B1CD242D275626532FDFFE4E-kPTMFJFq+rGvNW/NfzhIbrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-11-17 17:03               ` Olivier MATZ
     [not found]                 ` <546A2A69.5080004-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
2014-11-17 17:40                   ` Thomas Monjalon
2014-11-14 17:03       ` [PATCH v2 03/13] mbuf: move vxlan_cksum flag definition at the proper place Olivier Matz
     [not found]         ` <1415984609-2484-4-git-send-email-olivier.matz-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
2014-11-17 22:05           ` Thomas Monjalon
2014-11-18 14:10             ` Olivier MATZ
2014-11-14 17:03       ` [PATCH v2 04/13] mbuf: add help about TX checksum flags Olivier Matz
2014-11-14 17:03       ` [PATCH v2 05/13] mbuf: remove too specific PKT_TX_OFFLOAD_MASK definition Olivier Matz
     [not found]         ` <1415984609-2484-6-git-send-email-olivier.matz-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
2014-11-17 10:35           ` Bruce Richardson
2014-11-14 17:03       ` [PATCH v2 06/13] mbuf: add functions to get the name of an ol_flag Olivier Matz
     [not found]         ` <1415984609-2484-7-git-send-email-olivier.matz-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
2014-11-17 10:39           ` Bruce Richardson
2014-11-17 12:51             ` Olivier MATZ
2014-11-17 19:00           ` Ananyev, Konstantin
     [not found]             ` <2601191342CEEE43887BDE71AB977258213AE5A1-kPTMFJFq+rEu0RiL9chJVbfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-11-18  9:29               ` Olivier MATZ
     [not found]                 ` <546B1188.2090203-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
2014-11-19 11:06                   ` Ananyev, Konstantin
     [not found]                     ` <2601191342CEEE43887BDE71AB977258213B6BDA-kPTMFJFq+rEu0RiL9chJVbfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-11-25 10:37                       ` Ananyev, Konstantin
     [not found]                         ` <2601191342CEEE43887BDE71AB977258213B958A-kPTMFJFq+rEu0RiL9chJVbfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-11-25 12:15                           ` Zhang, Helin
     [not found]                             ` <F35DEAC7BCE34641BA9FAC6BCA4A12E70A7CAEA8-0J0gbvR4kTg/UvCtAeCM4rfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-11-25 12:37                               ` Olivier MATZ
     [not found]                                 ` <5474781F.6040501-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
2014-11-25 13:31                                   ` Zhang, Helin
2014-11-25 13:49                               ` Ananyev, Konstantin
     [not found]                                 ` <2601191342CEEE43887BDE71AB977258213B975F-kPTMFJFq+rEu0RiL9chJVbfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-11-26  0:58                                   ` Zhang, Helin
2014-11-14 17:03       ` [PATCH v2 07/13] testpmd: fix use of offload flags in testpmd Olivier Matz
2014-11-14 17:03       ` [PATCH v2 08/13] testpmd: rework csum forward engine Olivier Matz
     [not found]         ` <1415984609-2484-9-git-send-email-olivier.matz-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
2014-11-17  8:11           ` Liu, Jijiang
     [not found]             ` <1ED644BD7E0A5F4091CF203DAFB8E4CC01D9BB44-0J0gbvR4kThpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-11-17 13:00               ` Olivier MATZ
2014-11-14 17:03       ` [PATCH v2 09/13] mbuf: introduce new checksum API Olivier Matz
     [not found]         ` <1415984609-2484-10-git-send-email-olivier.matz-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
2014-11-17 18:15           ` Ananyev, Konstantin
     [not found]             ` <2601191342CEEE43887BDE71AB977258213AE563-kPTMFJFq+rEu0RiL9chJVbfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-11-18  9:10               ` Olivier MATZ
2014-11-14 17:03       ` [PATCH v2 10/13] mbuf: generic support for TCP segmentation offload Olivier Matz
     [not found]         ` <1415984609-2484-11-git-send-email-olivier.matz-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
2014-11-17 23:33           ` Ananyev, Konstantin
2014-11-14 17:03       ` [PATCH v2 11/13] ixgbe: support " Olivier Matz
     [not found]         ` <1415984609-2484-12-git-send-email-olivier.matz-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
2014-11-17 18:26           ` Ananyev, Konstantin
     [not found]             ` <2601191342CEEE43887BDE71AB977258213AE582-kPTMFJFq+rEu0RiL9chJVbfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-11-18  9:11               ` Olivier MATZ
2014-11-14 17:03       ` [PATCH v2 12/13] testpmd: support TSO in csum forward engine Olivier Matz
2014-11-14 17:03       ` [PATCH v2 13/13] testpmd: add a verbose mode " Olivier Matz
2014-11-20 22:58       ` [PATCH v3 00/13] add TSO support Olivier Matz
     [not found]         ` <1416524335-22753-1-git-send-email-olivier.matz-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
2014-11-20 22:58           ` [PATCH v3 01/13] igb/ixgbe: fix IP checksum calculation Olivier Matz
2014-11-20 22:58           ` [PATCH v3 02/13] ixgbe: fix remaining pkt_flags variable size to 64 bits Olivier Matz
2014-11-20 22:58           ` [PATCH v3 03/13] mbuf: reorder tx ol_flags Olivier Matz
     [not found]             ` <1416524335-22753-4-git-send-email-olivier.matz-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
2014-11-25 10:22               ` Thomas Monjalon
2014-11-20 22:58           ` [PATCH v3 04/13] mbuf: add help about TX checksum flags Olivier Matz
2014-11-20 22:58           ` [PATCH v3 05/13] mbuf: remove too specific PKT_TX_OFFLOAD_MASK definition Olivier Matz
2014-11-20 22:58           ` [PATCH v3 06/13] mbuf: add functions to get the name of an ol_flag Olivier Matz
     [not found]             ` <1416524335-22753-7-git-send-email-olivier.matz-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
2014-11-25 10:23               ` Thomas Monjalon
2014-11-20 22:58           ` [PATCH v3 07/13] testpmd: fix use of offload flags in testpmd Olivier Matz
     [not found]             ` <1416524335-22753-8-git-send-email-olivier.matz-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
2014-11-25 11:52               ` Ananyev, Konstantin
2014-11-20 22:58           ` [PATCH v3 08/13] testpmd: rework csum forward engine Olivier Matz
     [not found]             ` <1416524335-22753-9-git-send-email-olivier.matz-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
2014-11-26 10:10               ` Ananyev, Konstantin
     [not found]                 ` <2601191342CEEE43887BDE71AB977258213BA62A-kPTMFJFq+rEu0RiL9chJVbfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-11-26 11:14                   ` Olivier MATZ
     [not found]                     ` <5475B622.8030705-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
2014-11-26 12:25                       ` Ananyev, Konstantin
     [not found]                         ` <2601191342CEEE43887BDE71AB977258213BA869-kPTMFJFq+rEu0RiL9chJVbfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-11-26 14:55                           ` Olivier MATZ
     [not found]                             ` <5475E9D4.6000607-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
2014-11-26 16:34                               ` Ananyev, Konstantin
     [not found]                                 ` <2601191342CEEE43887BDE71AB977258213BA9DC-kPTMFJFq+rEu0RiL9chJVbfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-11-27  8:34                                   ` Liu, Jijiang
2014-11-26 13:59                       ` Liu, Jijiang
2014-11-20 22:58           ` [PATCH v3 09/13] mbuf: introduce new checksum API Olivier Matz
2014-11-20 22:58           ` [PATCH v3 10/13] mbuf: generic support for TCP segmentation offload Olivier Matz
2014-11-20 22:58           ` [PATCH v3 11/13] ixgbe: support " Olivier Matz
2014-11-20 22:58           ` [PATCH v3 12/13] testpmd: support TSO in csum forward engine Olivier Matz
2014-11-20 22:58           ` [PATCH v3 13/13] testpmd: add a verbose mode " Olivier Matz
2014-11-26 15:04           ` [PATCH v4 00/13] add TSO support Olivier Matz
     [not found]             ` <1417014295-29064-1-git-send-email-olivier.matz-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
2014-11-26 15:04               ` [PATCH v4 01/13] igb/ixgbe: fix IP checksum calculation Olivier Matz
2014-11-26 15:04               ` [PATCH v4 02/13] ixgbe: fix remaining pkt_flags variable size to 64 bits Olivier Matz
2014-11-26 15:04               ` [PATCH v4 03/13] mbuf: reorder tx ol_flags Olivier Matz
2014-11-26 15:04               ` [PATCH v4 04/13] mbuf: add help about TX checksum flags Olivier Matz
2014-11-26 15:04               ` [PATCH v4 05/13] mbuf: remove too specific PKT_TX_OFFLOAD_MASK definition Olivier Matz
2014-11-26 15:04               ` [PATCH v4 06/13] mbuf: add functions to get the name of an ol_flag Olivier Matz
2014-11-26 15:04               ` [PATCH v4 07/13] testpmd: fix use of offload flags in testpmd Olivier Matz
2014-11-26 15:04               ` [PATCH v4 08/13] testpmd: rework csum forward engine Olivier Matz
     [not found]                 ` <1417014295-29064-9-git-send-email-olivier.matz-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
2014-11-26 20:02                   ` Ananyev, Konstantin
     [not found]                     ` <2601191342CEEE43887BDE71AB977258213BAA86-kPTMFJFq+rEu0RiL9chJVbfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-11-27  8:26                       ` Liu, Jijiang
2014-11-27  9:10                       ` Olivier MATZ
     [not found]                         ` <5476EA87.4040807-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
2014-11-27 11:02                           ` Ananyev, Konstantin
     [not found]                             ` <2601191342CEEE43887BDE71AB977258213BACAB-kPTMFJFq+rEu0RiL9chJVbfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-11-28  8:54                               ` Liu, Jijiang
     [not found]                                 ` <1ED644BD7E0A5F4091CF203DAFB8E4CC01D9F23E-0J0gbvR4kThpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-11-28  9:54                                   ` Olivier MATZ
2014-11-26 15:04               ` [PATCH v4 09/13] mbuf: introduce new checksum API Olivier Matz
2014-11-26 15:04               ` [PATCH v4 10/13] mbuf: generic support for TCP segmentation offload Olivier Matz
2014-11-26 15:04               ` [PATCH v4 11/13] ixgbe: support " Olivier Matz
2014-11-26 15:04               ` [PATCH v4 12/13] testpmd: support TSO in csum forward engine Olivier Matz
     [not found]                 ` <1417014295-29064-13-git-send-email-olivier.matz-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
2014-11-26 21:23                   ` Ananyev, Konstantin
2014-11-26 15:04               ` [PATCH v4 13/13] testpmd: add a verbose mode " Olivier Matz
2014-11-26 18:30               ` [PATCH v4 00/13] add TSO support Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141110171059.GD10776@bricha3-MOBL3 \
    --to=bruce.richardson-ral2jqcrhueavxtiumwx3w@public.gmane.org \
    --cc=dev-VfR2kkLFssw@public.gmane.org \
    --cc=jigsaw-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=olivier.matz-pdR9zngts4EAvxtiuMwx3w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).