net: fix checksum API documentation
PATCH 1/1 net: fix checksum API documentation
Minor corrections and improvements to documentation for checksum APIs.
--- lib/net/rte_ip.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
lib/net/rte_ip.h +4 -4
@@ -488,7 +488,7 @@ rte_ipv6_phdr_cksum(const struct rte_ipv6_hdr *ipv6_hdr, uint64_t ol_flags) }/** -* @internal Calculate the non-complemented IPv4 L4 checksum +* @internal Calculate the non-complemented IPv6 L4 checksum */ static inline uint16_t __rte_ipv6_udptcp_cksum (const struct rte_ipv6_hdr *ipv6_hdr,const void *l4_hdr)
@@ -509,15 +509,15 @@ __rte_ipv6_udptcp_cksum(const struct rte_ipv6_hdr *ipv6_hdr, const void *l4_hdr)/** * Process the IPv6 UDP or TCP checksum. * -* The IPv4 header should not contains options. The layer 4 checksum -* must be set to 0 in the packet by the caller. +* The IPv6 header must not be followed by extension headers. The layer 4 +* checksum must be set to 0 in the L4 header by the caller. * * @param ipv6_hdr * The pointer to the contiguous IPv6 header. * @param l4_hdr * The pointer to the beginning of the L4 header. * @return -* The complemented checksum to set in the IP packet. +* The complemented checksum to set in the L4 header. */ static inline uint16_t rte_ipv6_udptcp_cksum (const struct rte_ipv6_hdr *ipv6_hdr,const void *l4_hdr)
Signature · 1 line
2.25.1
Quoted 45 lines
From: Lance Richardson [mailto:[email protected]]
Sent: Thursday, 16 September 2021 18.11Minor corrections and improvements to documentation for checksum APIs.
Fixes 6006818cfb26 ("net: new checksum functions")Fixes 45a08ef55e44 ("net: introduce functions to verify L4 checksums")Signed-off-by Lance Richardson <[email protected]>--- lib/net/rte_ip.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)lib/net/rte_ip.h +1
-1@@ -488,7 +488,7 @@ rte_ipv6_phdr_cksum(const struct rte_ipv6_hdr *ipv6_hdr, uint64_t ol_flags) }/** -* @internal Calculate the non-complemented IPv4 L4 checksum +* @internal Calculate the non-complemented IPv6 L4 checksum */ static inline uint16_t__rte_ipv6_udptcp_cksum(const struct
rte_ipv6_hdr*ipv6_hdr, const
void*l4_hdr)lib/net/rte_ip.h +1
-2@@ -509,15 +509,15 @@ __rte_ipv6_udptcp_cksum(const struct rte_ipv6_hdr *ipv6_hdr, const void *l4_hdr)/** * Process the IPv6 UDP or TCP checksum. * -* The IPv4 header should not contains options. The layer 4 checksum -* must be set to 0 in the packet by the caller. +* The IPv6 header must not be followed by extension headers. The layer 4
+ * checksum must be set to 0 in the L4 header by the caller. *
* @paramipv6_hdr
* The pointer to the contiguous IPv6 header.
* @paraml4_hdr
* The pointer to the beginning of the L4 header.
* @return
Quoted 8 lines
- * The complemented checksum to set in the IP packet.
+ * The complemented checksum to set in the L4 header.
*/
static inlineuint16_t
rte_ipv6_udptcp_cksum(const structrte_ipv6_hdr*ipv6_hdr, const void*l4_hdr)
--
2.25.1
Quoted 39 lines · Morten Brørup
Quoted 39 lines
From: Lance Richardson [mailto:[email protected]]
Sent: Thursday, 16 September 2021 18.11Minor corrections and improvements to documentation for checksum APIs.
Fixes 6006818cfb26 ("net: new checksum functions")Fixes 45a08ef55e44 ("net: introduce functions to verify L4 checksums")Signed-off-by Lance Richardson <[email protected]>--- lib/net/rte_ip.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)lib/net/rte_ip.h +1
-1@@ -488,7 +488,7 @@ rte_ipv6_phdr_cksum(const struct rte_ipv6_hdr *ipv6_hdr, uint64_t ol_flags) }/** -* @internal Calculate the non-complemented IPv4 L4 checksum +* @internal Calculate the non-complemented IPv6 L4 checksum */ static inline uint16_t__rte_ipv6_udptcp_cksum(const struct
rte_ipv6_hdr*ipv6_hdr, const
void*l4_hdr)lib/net/rte_ip.h +1
-2@@ -509,15 +509,15 @@ __rte_ipv6_udptcp_cksum(const struct rte_ipv6_hdr *ipv6_hdr, const void *l4_hdr)/** * Process the IPv6 UDP or TCP checksum. * -* The IPv4 header should not contains options. The layer 4 checksum -* must be set to 0 in the packet by the caller. +* The IPv6 header must not be followed by extension headers. The layer 4
+ * checksum must be set to 0 in the L4 header by the caller.
Quoted 8 lines
Quoted 8 lines
*
* @paramipv6_hdr
* The pointer to the contiguous IPv6 header.
* @paraml4_hdr
* The pointer to the beginning of the L4 header.
* @return
- * The complemented checksum to set in the IP packet.
+ * The complemented checksum to set in the L4 header.
Isn't this wrong for 'rte_ipv4_udptcp_cksum()' too? Since you are touching this, can you fix that one too?
Quoted 9 lines
Quoted 6 lines
*/
static inlineuint16_t
rte_ipv6_udptcp_cksum(const structrte_ipv6_hdr*ipv6_hdr, const void*l4_hdr)
--
2.25.1Reviewed-by Morten Brørup <[email protected]>
Quoted 55 lines
From: dev [mailto:[email protected]] On Behalf Of Ferruh Yigit
Sent: Tuesday, 21 September 2021 11.28Quoted 8 lines · Morten Brørup
Quoted 8 lines
From: Lance Richardson [mailto:[email protected]]
Sent: Thursday, 16 September 2021 18.11Minor corrections and improvements to documentation for checksum APIs.
Fixes 6006818cfb26 ("net: new checksum functions")Fixes 45a08ef55e44 ("net: introduce functions to verify L4checksums")
Quoted 14 lines
Quoted 14 lines
Signed-off-by Lance Richardson <[email protected]>--- lib/net/rte_ip.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)lib/net/rte_ip.h +0
-0@@ -488,7 +488,7 @@ rte_ipv6_phdr_cksum(const struct rte_ipv6_hdr *ipv6_hdr, uint64_t ol_flags) }Quoted 8 lines
lib/net/rte_ip.h __rte_ipv6_udptcp_cksum(const struct
Quoted 8 lines
lib/net/rte_ip.h +1
-1/** -* @internal Calculate the non-complemented IPv4 L4 checksum +* @internal Calculate the non-complemented IPv6 L4 checksum */ static inline uint16_t__rte_ipv6_udptcp_cksum(const struct
rte_ipv6_hdr*ipv6_hdr, const
void*l4_hdr)lib/net/rte_ip.h +0
-0@@ -509,15 +509,15 @@ __rte_ipv6_udptcp_cksum(const struct
rte_ipv6_hdrQuoted 5 lines
lib/net/rte_ip.h __rte_ipv6_udptcp_cksum(const struct rte_ipv6_hdr *ipv6_hdr, const void *l4_hdr)
Quoted 5 lines
lib/net/rte_ip.h +0
-1*ipv6_hdr, const void *l4_hdr)/** * Process the IPv6 UDP or TCP checksum. * -* The IPv4 header should not contains options. The layer 4 checksum
Quoted 4 lines
Quoted 4 lines
lib/net/rte_ip.h +1
-1-* must be set to 0 in the packet by the caller. +* The IPv6 header must not be followed by extension headers. The layer 4
+ * checksum must be set to 0 in the L4 header by the caller.Quoted 8 lines
Quoted 8 lines
*
* @paramipv6_hdr
* The pointer to the contiguous IPv6 header.
* @paraml4_hdr
* The pointer to the beginning of the L4 header.
* @return
- * The complemented checksum to set in the IP packet.
+ * The complemented checksum to set in the L4 header.
Quoted 4 lines
Isn't this wrong for '
rte_ipv4_udptcp_cksum()' too? Since you are touching this,
can you fix that one too?
Ferruh, the description of the return value is technically correct; it mentions the IP packet, not the IP header. So this change is a clarification only.
However, I agree that the same clarification would also benefit 'rte_ipv4_udptcp_cksum()'.
Quoted 11 lines
Quoted 3 lines
Quoted 3 lines
*/
static inlineuint16_t
rte_ipv6_udptcp_cksum(const structrte_ipv6_hdr*ipv6_hdr, constvoid
Quoted 6 lines
Quoted 3 lines
*l4_hdr)
--
2.25.1Reviewed-by Morten Brørup <[email protected]>
Quoted 5 lines · Morten Brørup
Ferruh, the description of the return value is technically correct; it mentions the IP packet, not the IP header. So this change is a clarification only.
However, I agree that the same clarification would also benefit '
rte_ipv4_udptcp_cksum()'.
Sure, will fix in v2.
Also for rte_ipv4_udptcp_cksum(), a comment says "The IP and layer 4 checksum must be set to zero", but only the layer 4 checksum actually needs to be set to zero. I'll fix that at the same time.
Thanks,
Lance
PATCH v2 1/1 net: fix checksum API documentation
In reply to Lance RichardsonMinor corrections and improvements to documentation for checksum APIs.
---
v2:
- Updates for rte_ipv4_udptcp_cksum()
lib/net/rte_ip.h | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-)
lib/net/rte_ip.h +6 -7
@@ -371,15 +371,14 @@ __rte_ipv4_udptcp_cksum(const struct rte_ipv4_hdr *ipv4_hdr, const void *l4_hdr)/** * Process the IPv4 UDP or TCP checksum. * -* The IP and layer 4 checksum must be set to 0 in the packet by -* the caller. +* The layer 4 checksum must be set to 0 in the L4 header by the caller. * * @param ipv4_hdr * The pointer to the contiguous IPv4 header. * @param l4_hdr * The pointer to the beginning of the L4 header. * @return -* The complemented checksum to set in the IP packet. +* The complemented checksum to set in the L4 header. */ static inline uint16_t rte_ipv4_udptcp_cksum (const struct rte_ipv4_hdr *ipv4_hdr,const void *l4_hdr)
@@ -488,7 +487,7 @@ rte_ipv6_phdr_cksum(const struct rte_ipv6_hdr *ipv6_hdr, uint64_t ol_flags) }/** -* @internal Calculate the non-complemented IPv4 L4 checksum +* @internal Calculate the non-complemented IPv6 L4 checksum */ static inline uint16_t __rte_ipv6_udptcp_cksum (const struct rte_ipv6_hdr *ipv6_hdr,const void *l4_hdr)
@@ -509,15 +508,15 @@ __rte_ipv6_udptcp_cksum(const struct rte_ipv6_hdr *ipv6_hdr, const void *l4_hdr)/** * Process the IPv6 UDP or TCP checksum. * -* The IPv4 header should not contains options. The layer 4 checksum -* must be set to 0 in the packet by the caller. +* The IPv6 header must not be followed by extension headers. The layer 4 +* checksum must be set to 0 in the L4 header by the caller. * * @param ipv6_hdr * The pointer to the contiguous IPv6 header. * @param l4_hdr * The pointer to the beginning of the L4 header. * @return -* The complemented checksum to set in the IP packet. +* The complemented checksum to set in the L4 header. */ static inline uint16_t rte_ipv6_udptcp_cksum (const struct rte_ipv6_hdr *ipv6_hdr,const void *l4_hdr)
Signature · 1 line
2.25.1
Quoted 7 lines · Lance Richardson
Minor corrections and improvements to documentation for checksum APIs.
Fixes 6006818cfb26 ("net: new checksum functions")Fixes 45a08ef55e44 ("net: introduce functions to verify L4 checksums")Signed-off-by Lance Richardson <[email protected]>
Olivier Matz
Acked-byQuoted 11 lines · Ferruh Yigit
Quoted 7 lines · Lance Richardson
Minor corrections and improvements to documentation for checksum APIs.
Fixes 6006818cfb26 ("net: new checksum functions")Fixes 45a08ef55e44 ("net: introduce functions to verify L4 checksums")Signed-off-by Lance Richardson <[email protected]>Acked-by Ferruh Yigit <[email protected]>
Thanks!
Ferruh Yigit
AppliedQuoted 10 lines · Olivier Matz
Quoted 9 lines · Ferruh Yigit
Quoted 7 lines · Lance Richardson
Minor corrections and improvements to documentation for checksum APIs.
Fixes 6006818cfb26 ("net: new checksum functions")Fixes 45a08ef55e44 ("net: introduce functions to verify L4 checksums")Signed-off-by Lance Richardson <[email protected]>
Quoted 5 lines
Quoted 2 lines
Acked-by Ferruh Yigit <[email protected]>Acked-by Olivier Matz <[email protected]>
Applied to dpdk-next-net/main, thanks.