Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

src: Improve comment.



details:   https://anonhg.NetBSD.org/src/rev/9bacd4d98e4f
branches:  trunk
changeset: 318127:9bacd4d98e4f
user:      maxv <maxv%NetBSD.org@localhost>
date:      Fri Apr 13 07:30:46 2018 +0000
description:
Improve comment.

diffstat:

 sys/sys/mbuf.h |  25 ++++++++++++++++---------
 1 files changed, 16 insertions(+), 9 deletions(-)

diffs (40 lines):

diff -r d41847f1f3a6 -r 9bacd4d98e4f sys/sys/mbuf.h
--- a/sys/sys/mbuf.h    Fri Apr 13 06:15:26 2018 +0000
+++ b/sys/sys/mbuf.h    Fri Apr 13 07:30:46 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mbuf.h,v 1.182 2018/04/10 16:12:30 maxv Exp $  */
+/*     $NetBSD: mbuf.h,v 1.183 2018/04/13 07:30:46 maxv Exp $  */
 
 /*
  * Copyright (c) 1996, 1997, 1999, 2001, 2007 The NetBSD Foundation, Inc.
@@ -161,15 +161,22 @@
 /*
  * record/packet header in first mbuf of chain; valid if M_PKTHDR set
  *
- * A note about csum_data: For the out-bound direction, the low 16 bits
- * indicates the offset after the L4 header where the final L4 checksum value
- * is to be stored and the high 16 bits is the length of the L3 header (the
- * start of the data to be checksumed).  For the in-bound direction, it is only
- * valid if the M_CSUM_DATA flag is set.  In this case, an L4 checksum has been
- * calculated by hardware, but it is up to software to perform final
- * verification.
+ * A note about csum_data:
+ *
+ *  o For the out-bound direction, the low 16 bits indicates the offset after
+ *    the L4 header where the final L4 checksum value is to be stored
+ *    (checksumming flags) and the high 16 bits is the length of the L3 header
+ *    (the start of the data to be checksummed):
  *
- * Note for in-bound TCP/UDP checksums, we expect the csum_data to NOT
+ *                     +------------------+--------------------+
+ *          csum_data: | L3 header length | Checksumming flags |
+ *                     +------------------+--------------------+
+ *
+ *  o For the in-bound direction, it is only valid if the M_CSUM_DATA flag is
+ *    set. In this case, an L4 checksum has been calculated by hardware, but
+ *    it is up to software to perform final verification.
+ *
+ * Note for in-bound TCP/UDP checksums: we expect the csum_data to NOT
  * be bit-wise inverted (the final step in the calculation of an IP
  * checksum) -- this is so we can accumulate the checksum for fragmented
  * packets during reassembly.



Home | Main Index | Thread Index | Old Index