Skip to content

Commit 99ed546

Browse files
fjtrujyclaude
andcommitted
opt: [tcpip] disable IP reassembly and fragmentation on IOP
PS2 networking targets a local LAN with MTU=1500, and TCP negotiates MSS=1460 so IP fragmentation never arises in the common case. Turn off IP_REASSEMBLY and IP_FRAG to drop the corresponding lwIP code paths and free their static pool slots (MEMP_NUM_REASSDATA / MEMP_NUM_FRAG_PBUF). Savings observed in ps2ip-nm.irx: 94805 -> 91509 bytes (-3.3 KB of code), plus runtime pool memory that no longer needs to be reserved. ps2link end-to-end test (execee over TCP) confirmed unaffected. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 48b49d7 commit 99ed546

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

iop/tcpip/tcpip-base/include/lwipopts.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,25 @@
104104
Up to TCP_SND_BUF * 2 segments may be transmitted at once, thanks to Nagle and Delayed Ack. */
105105
#define MEM_SIZE (TCP_SND_BUF * 2)
106106

107+
/*
108+
-----------------------------------------------
109+
---------- IP options -------------------------
110+
-----------------------------------------------
111+
*/
112+
/**
113+
* IP_REASSEMBLY==1: Reassemble incoming fragmented IP packets.
114+
* Disabled: PS2 networking targets a local LAN with MTU=1500, and
115+
* TCP negotiates MSS=1460 so fragments never arise in the common
116+
* case. Frees MEMP_NUM_REASSDATA / MEMP_NUM_FRAG_PBUF pool entries.
117+
*/
118+
#define IP_REASSEMBLY 0
119+
120+
/**
121+
* IP_FRAG==1: Fragment outgoing IP packets if their size exceeds MTU.
122+
* Disabled: TCP_MSS=1460 ensures we never exceed Ethernet MTU=1500.
123+
*/
124+
#define IP_FRAG 0
125+
107126
/*
108127
------------------------------------------------
109128
---------- Internal Memory Pool Sizes ----------

0 commit comments

Comments
 (0)