From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f180.google.com (mail-wi0-f180.google.com [209.85.212.180]) by dpdk.org (Postfix) with ESMTP id 2802B7F0C for ; Thu, 20 Nov 2014 23:48:35 +0100 (CET) Received: by mail-wi0-f180.google.com with SMTP id n3so7028526wiv.7 for ; Thu, 20 Nov 2014 14:59:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=NjWAa/cEQdBM7ZSO0B6h39hiHkiXFyBMolS5RmVFPi0=; b=foZcDIX4ZbW1RG/K8rGLV51aqkDY8NojXam9K2WKmGATfd6gWN1fEpXqS9UVrqRySi KuW/fBNHBpaqW72dfdwuG6xR8HTTBwE0nA0tSdD7JgAS0LOGNy3h33zPpzoMTE2mL5Kq l8dMVjd4aS3GzP4n/NUrtbMKAyEksAT1RRWTFhMzBAhAckBeG5meA4RCF+uF4WQYf16w xfXgpYVIwyL0dVtDuS1iIzSYp9AZwshIJ9FPQUywCMXSvDI3FOIKNd5rc8OrJOjSXjg/ inI+YfBzuKA4otDx6uuDSdZjypBoit84OWM/80hTruNPzl+NTX6NOJteJgA9MM593TGN bedQ== X-Gm-Message-State: ALoCoQncqTsFx/FC8GrymZUkGWgbYWuUSqhF+mhJPpzV36IRuA/3wo9sPLqVbMn298tDo4ZM/uBm X-Received: by 10.194.187.164 with SMTP id ft4mr1456169wjc.76.1416524347060; Thu, 20 Nov 2014 14:59:07 -0800 (PST) Received: from glumotte.dev.6wind.com (guy78-3-82-239-227-177.fbx.proxad.net. [82.239.227.177]) by mx.google.com with ESMTPSA id cz3sm5380581wjb.23.2014.11.20.14.59.06 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 20 Nov 2014 14:59:06 -0800 (PST) From: Olivier Matz To: dev@dpdk.org Date: Thu, 20 Nov 2014 23:58:46 +0100 Message-Id: <1416524335-22753-5-git-send-email-olivier.matz@6wind.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1416524335-22753-1-git-send-email-olivier.matz@6wind.com> References: <1415984609-2484-1-git-send-email-olivier.matz@6wind.com> <1416524335-22753-1-git-send-email-olivier.matz@6wind.com> Cc: jigsaw@gmail.com Subject: [dpdk-dev] [PATCH v3 04/13] mbuf: add help about TX checksum flags X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Nov 2014 22:48:35 -0000 Describe how to use hardware checksum API. Signed-off-by: Olivier Matz Acked-by: Bruce Richardson --- lib/librte_mbuf/rte_mbuf.h | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h index d3eba44..0c96b00 100644 --- a/lib/librte_mbuf/rte_mbuf.h +++ b/lib/librte_mbuf/rte_mbuf.h @@ -98,14 +98,17 @@ extern "C" { /* add new TX flags here */ #define PKT_TX_VXLAN_CKSUM (1ULL << 50) /**< TX checksum of VXLAN computed by NIC */ #define PKT_TX_IEEE1588_TMST (1ULL << 51) /**< TX IEEE1588 packet to timestamp. */ -/* - * 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