Skip to contentSkip to conversation

doc: updated incorrect value for IP frag max fragments

PATCH Superseded Euan Bourke 3 participants 4 messages Dec 19, 2023 – Dec 20, 2023

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 doc: updated incorrect value for IP frag max fragments

Docs for IP Fragment said RTE_LIBRTE_IP_FRAG_MAX_FRAGS was 4 by default, however this was changed to 8.

Documentation has been updated to account for this, including a snippet of the code where RTE_LIBRTE_IP_FRAG_MAX_FRAGS is defined to ensure the documentation stays up to date.

---
 .mailmap                                             | 1 +
 doc/guides/prog_guide/ip_fragment_reassembly_lib.rst | 7 ++++++-
 2 files changed, 7 insertions(+), 1 deletion(-)
.mailmap +1 -0
index ab0742a382..528bc68a30 100644
@@ -379,6 +379,7 @@ Eric Zhang <[email protected]>
 Erik Gabriel Carrillo <[email protected]>
 Erik Ziegenbalg <[email protected]>
 Erlu Chen <[email protected]>
+Euan Bourke <[email protected]>
 Eugenio Pérez <[email protected]>
 Eugeny Parshutin <[email protected]>
 Evan Swanson <[email protected]>
doc/guides/prog_guide/ip_fragment_reassembly_lib.rst +6 -1
index 314d4adbb8..458d7c6776 100644
@@ -43,7 +43,12 @@ Note that all update/lookup operations on Fragment Table are not thread safe.
 So if different execution contexts (threads/processes) will access the same table simultaneously,
 then some external syncing mechanism have to be provided.
 
-Each table entry can hold information about packets consisting of up to RTE_LIBRTE_IP_FRAG_MAX (by default: 4) fragments.
+Each table entry can hold information about packets of up to ``RTE_LIBRTE_IP_FRAG_MAX_FRAGS`` fragments,
+where ``RTE_LIBRTE_IP_FRAG_MAX_FRAGS`` defaults to:
+
+.. literalinclude:: ../../../config/rte_config.h
+    :start-after: /* ip_fragmentation defines */
+    :lines: 1
 
 Code example, that demonstrates creation of a new Fragment table:
 
Signature · 1 line
2.34.1
#1 lore raw

PATCH 2/2 ip_frag: updated name for IP frag define

Removed LIBRTE from name as its an old prefix.

---
 app/test/test_reassembly_perf.c                      | 2 +-
 config/rte_config.h                                  | 2 +-
 doc/guides/prog_guide/ip_fragment_reassembly_lib.rst | 4 ++--
 doc/guides/sample_app_ug/ip_reassembly.rst           | 4 ++--
 examples/ip_fragmentation/main.c                     | 2 +-
 examples/ip_reassembly/main.c                        | 2 +-
 examples/ipsec-secgw/ipsec_worker.h                  | 2 +-
 lib/ip_frag/ip_reassembly.h                          | 2 +-
 lib/ip_frag/rte_ip_frag.h                            | 2 +-
 9 files changed, 11 insertions(+), 11 deletions(-)
app/test/test_reassembly_perf.c +1 -1
index 3912179022..805ae2fe9d 100644
@@ -20,7 +20,7 @@
 #define MAX_FLOWS	    (1024 * 32)
 #define MAX_BKTS	    MAX_FLOWS
 #define MAX_ENTRIES_PER_BKT 16
-#define MAX_FRAGMENTS	    RTE_LIBRTE_IP_FRAG_MAX_FRAG
+#define MAX_FRAGMENTS	    RTE_IP_FRAG_MAX_FRAG
 #define MIN_FRAGMENTS	    2
 #define MAX_PKTS	    (MAX_FLOWS * MAX_FRAGMENTS)
 
config/rte_config.h +1 -1
index da265d7dd2..e2fa2a58fa 100644
@@ -85,7 +85,7 @@
 #define RTE_RAWDEV_MAX_DEVS 64
 
 /* ip_fragmentation defines */
-#define RTE_LIBRTE_IP_FRAG_MAX_FRAG 8
+#define RTE_IP_FRAG_MAX_FRAG 8
 // RTE_LIBRTE_IP_FRAG_TBL_STAT is not set
 
 /* rte_power defines */
doc/guides/prog_guide/ip_fragment_reassembly_lib.rst +2 -2
index 458d7c6776..230baeaa19 100644
@@ -43,8 +43,8 @@ Note that all update/lookup operations on Fragment Table are not thread safe.
 So if different execution contexts (threads/processes) will access the same table simultaneously,
 then some external syncing mechanism have to be provided.
 
-Each table entry can hold information about packets of up to ``RTE_LIBRTE_IP_FRAG_MAX_FRAGS`` fragments,
-where ``RTE_LIBRTE_IP_FRAG_MAX_FRAGS`` defaults to:
+Each table entry can hold information about packets of up to ``RTE_IP_FRAG_MAX_FRAGS`` fragments,
+where ``RTE_IP_FRAG_MAX_FRAGS`` defaults to:
 
 .. literalinclude:: ../../../config/rte_config.h
     :start-after: /* ip_fragmentation defines */
doc/guides/sample_app_ug/ip_reassembly.rst +2 -2
index 5280bf4ea0..9cf4fb3f7d 100644
@@ -135,7 +135,7 @@ Fragment table maintains information about already received fragments of the pac
 Each IP packet is uniquely identified by triple <Source IP address>, <Destination IP address>, <ID>.
 To avoid lock contention, each RX queue has its own Fragment Table,
 e.g. the application can't handle the situation when different fragments of the same packet arrive through different RX queues.
-Each table entry can hold information about packet consisting of up to RTE_LIBRTE_IP_FRAG_MAX_FRAGS fragments.
+Each table entry can hold information about packet consisting of up to RTE_IP_FRAG_MAX_FRAGS fragments.
 
 .. literalinclude:: ../../../examples/ip_reassembly/main.c
     :language: c
@@ -147,7 +147,7 @@ Mempools Initialization
 ~~~~~~~~~~~~~~~~~~~~~~~
 
 The reassembly application demands a lot of mbuf's to be allocated.
-At any given time up to (2 \* max_flow_num \* RTE_LIBRTE_IP_FRAG_MAX_FRAGS \* <maximum number of mbufs per packet>)
+At any given time up to (2 \* max_flow_num \* RTE_IP_FRAG_MAX_FRAGS \* <maximum number of mbufs per packet>)
 can be stored inside Fragment Table waiting for remaining fragments.
 To keep mempool size under reasonable limits and to avoid situation when one RX queue can starve other queues,
 each RX queue uses its own mempool.
examples/ip_fragmentation/main.c +1 -1
index 744a1aa9b4..1e4471891b 100644
@@ -71,7 +71,7 @@
 /*
  * Max number of fragments per packet expected - defined by config file.
  */
-#define	MAX_PACKET_FRAG RTE_LIBRTE_IP_FRAG_MAX_FRAG
+#define	MAX_PACKET_FRAG RTE_IP_FRAG_MAX_FRAG
 
 #define NB_MBUF   8192
 
examples/ip_reassembly/main.c +1 -1
index bd0b1d31de..16607d99f3 100644
@@ -69,7 +69,7 @@
 #define	MIN_FLOW_TTL	1
 #define	DEF_FLOW_TTL	MS_PER_S
 
-#define MAX_FRAG_NUM RTE_LIBRTE_IP_FRAG_MAX_FRAG
+#define MAX_FRAG_NUM RTE_IP_FRAG_MAX_FRAG
 
 /* Should be power of two. */
 #define	IP_FRAG_TBL_BUCKET_ENTRIES	16
examples/ipsec-secgw/ipsec_worker.h +1 -1
index ac980b8bcf..918e6b5200 100644
@@ -291,7 +291,7 @@ send_fragment_packet(struct lcore_conf *qconf, struct rte_mbuf *m,
 	len = tbl->len;
 
 	/* free space for new fragments */
-	if (len + RTE_LIBRTE_IP_FRAG_MAX_FRAG >=  RTE_DIM(tbl->m_table)) {
+	if (len + RTE_IP_FRAG_MAX_FRAG >=  RTE_DIM(tbl->m_table)) {
 		send_burst(qconf, len, port);
 		len = 0;
 	}
lib/ip_frag/ip_reassembly.h +1 -1
index a9f97aefca..77c22ca9d1 100644
@@ -16,7 +16,7 @@ enum {
 	IP_LAST_FRAG_IDX,    /* index of last fragment */
 	IP_FIRST_FRAG_IDX,   /* index of first fragment */
 	IP_MIN_FRAG_NUM,     /* minimum number of fragments */
-	IP_MAX_FRAG_NUM = RTE_LIBRTE_IP_FRAG_MAX_FRAG,
+	IP_MAX_FRAG_NUM = RTE_IP_FRAG_MAX_FRAG,
 	/* maximum number of fragments per packet */
 };
 
lib/ip_frag/rte_ip_frag.h +1 -1
index 2ad318096b..6465ec316b 100644
@@ -32,7 +32,7 @@ struct rte_mbuf;
 
 /** death row size in mbufs */
 #define RTE_IP_FRAG_DEATH_ROW_MBUF_LEN \
-	(RTE_IP_FRAG_DEATH_ROW_LEN * (RTE_LIBRTE_IP_FRAG_MAX_FRAG + 1))
+	(RTE_IP_FRAG_DEATH_ROW_LEN * (RTE_IP_FRAG_MAX_FRAG + 1))
 
 /** mbuf death row (packets to be freed) */
 struct rte_ip_frag_death_row {
Signature · 1 line
2.34.1
#2 lore raw
In reply to Euan Bourke

19/12/2023 16:17, Euan Bourke:

doc/guides/prog_guide/ip_fragment_reassembly_lib.rst Note that all update/lookup operations on Fragment Table are not thread safe. · line 47

Quoted 2 lines
doc/guides/prog_guide/ip_fragment_reassembly_lib.rst +2 -0
+Each table entry can hold information about packets of up to ``RTE_LIBRTE_IP_FRAG_MAX_FRAGS`` fragments,
+where ``RTE_LIBRTE_IP_FRAG_MAX_FRAGS`` defaults to:

Instead of repeating the name, you can use "it".

doc/guides/prog_guide/ip_fragment_reassembly_lib.rst Note that all update/lookup operations on Fragment Table are not thread safe. · line 51

Quoted 4 lines
doc/guides/prog_guide/ip_fragment_reassembly_lib.rst +4 -0
+
+.. literalinclude:: ../../../config/rte_config.h
+    :start-after: /* ip_fragmentation defines */
+    :lines: 1

Relying on the comment before is a bit fragile here. Please use "start-at".

#3 lore raw
Quoted 6 lines · Thomas Monjalon

19/12/2023 16:17, Euan Bourke:

doc/guides/prog_guide/ip_fragment_reassembly_lib.rst Note that all update/lookup operations on Fragment Table are not thread safe. · line 47

Quoted 2 lines
doc/guides/prog_guide/ip_fragment_reassembly_lib.rst +2 -0
+Each table entry can hold information about packets of up to ``RTE_LIBRTE_IP_FRAG_MAX_FRAGS`` fragments,
+where ``RTE_LIBRTE_IP_FRAG_MAX_FRAGS`` defaults to:

Instead of repeating the name, you can use "it".

In this instance, I actually think it's better to repeat the name - as "it" would read strangely, and could refer to "table entry" or "information" either.

/Bruce