-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Network Loopbacka Driver: Configuration to control packet size #248
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Historically, the loopback driver used the largest packet size of all enabled link layer protocols. This permitted packets to be forward via the loopbak device with no major loss of performance. However, in experimenting with configurations where no other link layer protocols were enabled, this means the loopback packet size was set to the smallest possible size, to the SLIP minimum of 296 bytes. This resulted in terrible loopback performance. This commit adds an option to increase the loopback packet size with the option CONFIG_NET_LOOPBACK_PACKETSIZE. The loopback driver packet buffer should be quite large. The larger the loopback packet buffer, the better will be TCP performance of the loopback transfers. The Linux loopback device historically used packet buffers of size 16Kb, but that was increased in recent Linux versions to 64Kb. Those sizes may be excessive for resource constrained MCUs, however. The network still enforces the lower limit that is the maximum packet size of all enabled link layer protocols. But this new option permits the loopback packet size to be increased from that. * net/Kconfig: Adds CONFIG_NET_LOOPBACK_PKTSIZE option * include/nuttx/net/netconfig.h: Assures that the packet size that is used is at least as large as the largest packet size of other link layer protocols. * drivers/net/loopback.c: Use that larger packet size. * boards/sim/sim/sim/configs/tcploop/defconfig: Set the loopback packet size to 1500
patacongo
changed the title
Network Loopbacka Driver: A configuration option to control packet s…
Network Loopbacka Driver: Configuration to control packet size
Feb 11, 2020
anchao
added a commit
to anchao/nuttx
that referenced
this pull request
Oct 25, 2024
modify the prototype of up_putc(): remove the return value The architecture code does not care about the return value of up_putc(), so removing it saves two statements: Before: After: de4c: e52de004 push {lr} @ (str lr, [sp, #-4]!) | de4c: e52de004 push {lr} @ (str lr, [sp, #-4]!) de50: e24dd014 sub sp, sp, apache#20 | de50: e24dd014 sub sp, sp, apache#20 de54: e58d0004 str r0, [sp, #4] | de54: e58d0004 str r0, [sp, #4] de58: e30030f8 movw r3, apache#248 @ 0xf8 | de58: e30030f8 movw r3, apache#248 @ 0xf8 de5c: e3423000 movt r3, apache#8192 @ 0x2000 | de5c: e3423000 movt r3, apache#8192 @ 0x2000 de60: e58d300c str r3, [sp, apache#12] | de60: e58d300c str r3, [sp, apache#12] de64: e59d1004 ldr r1, [sp, #4] | de64: e59d1004 ldr r1, [sp, #4] de68: e59d000c ldr r0, [sp, apache#12] | de68: e59d000c ldr r0, [sp, apache#12] de6c: ebfffe66 bl d80c <pl011_putc> | de6c: ebfffe66 bl d80c <pl011_putc> de70: e59d3004 ldr r3, [sp, #4] | de70: e28dd014 add sp, sp, apache#20 de74: e1a0000 mov r0, r3 | de74: e49df004 pop {pc} @ (ldr pc, [sp], #4) de78: e28dd014 add sp, sp, apache#20 | de7c: e49df004 pop {pc} @ (ldr pc, [sp], #4) | Signed-off-by: chao an <[email protected]>
anchao
added a commit
to anchao/nuttx
that referenced
this pull request
Oct 25, 2024
modify the prototype of up_putc(): remove the return value The architecture code does not care about the return value of up_putc(), so removing it saves two statements: Before: After: de4c: e52de004 push {lr} @ (str lr, [sp, #-4]!) | de4c: e52de004 push {lr} @ (str lr, [sp, #-4]!) de50: e24dd014 sub sp, sp, apache#20 | de50: e24dd014 sub sp, sp, apache#20 de54: e58d0004 str r0, [sp, #4] | de54: e58d0004 str r0, [sp, #4] de58: e30030f8 movw r3, apache#248 @ 0xf8 | de58: e30030f8 movw r3, apache#248 @ 0xf8 de5c: e3423000 movt r3, apache#8192 @ 0x2000 | de5c: e3423000 movt r3, apache#8192 @ 0x2000 de60: e58d300c str r3, [sp, apache#12] | de60: e58d300c str r3, [sp, apache#12] de64: e59d1004 ldr r1, [sp, #4] | de64: e59d1004 ldr r1, [sp, #4] de68: e59d000c ldr r0, [sp, apache#12] | de68: e59d000c ldr r0, [sp, apache#12] de6c: ebfffe66 bl d80c <pl011_putc> | de6c: ebfffe66 bl d80c <pl011_putc> de70: e59d3004 ldr r3, [sp, #4] | de70: e28dd014 add sp, sp, apache#20 de74: e1a0000 mov r0, r3 | de74: e49df004 pop {pc} @ (ldr pc, [sp], #4) de78: e28dd014 add sp, sp, apache#20 | de7c: e49df004 pop {pc} @ (ldr pc, [sp], #4) | Signed-off-by: chao an <[email protected]>
anchao
added a commit
to anchao/nuttx
that referenced
this pull request
Oct 26, 2024
modify the prototype of up_putc(): remove the return value The architecture code does not care about the return value of up_putc(), so removing it saves two statements: Before: After: de4c: e52de004 push {lr} @ (str lr, [sp, #-4]!) | de4c: e52de004 push {lr} @ (str lr, [sp, #-4]!) de50: e24dd014 sub sp, sp, apache#20 | de50: e24dd014 sub sp, sp, apache#20 de54: e58d0004 str r0, [sp, #4] | de54: e58d0004 str r0, [sp, #4] de58: e30030f8 movw r3, apache#248 @ 0xf8 | de58: e30030f8 movw r3, apache#248 @ 0xf8 de5c: e3423000 movt r3, apache#8192 @ 0x2000 | de5c: e3423000 movt r3, apache#8192 @ 0x2000 de60: e58d300c str r3, [sp, apache#12] | de60: e58d300c str r3, [sp, apache#12] de64: e59d1004 ldr r1, [sp, #4] | de64: e59d1004 ldr r1, [sp, #4] de68: e59d000c ldr r0, [sp, apache#12] | de68: e59d000c ldr r0, [sp, apache#12] de6c: ebfffe66 bl d80c <pl011_putc> | de6c: ebfffe66 bl d80c <pl011_putc> de70: e59d3004 ldr r3, [sp, #4] | de70: e28dd014 add sp, sp, apache#20 de74: e1a0000 mov r0, r3 | de74: e49df004 pop {pc} @ (ldr pc, [sp], #4) de78: e28dd014 add sp, sp, apache#20 | de7c: e49df004 pop {pc} @ (ldr pc, [sp], #4) | Signed-off-by: chao an <[email protected]>
xiaoxiang781216
pushed a commit
that referenced
this pull request
Oct 26, 2024
modify the prototype of up_putc(): remove the return value The architecture code does not care about the return value of up_putc(), so removing it saves two statements: Before: After: de4c: e52de004 push {lr} @ (str lr, [sp, #-4]!) | de4c: e52de004 push {lr} @ (str lr, [sp, #-4]!) de50: e24dd014 sub sp, sp, #20 | de50: e24dd014 sub sp, sp, #20 de54: e58d0004 str r0, [sp, #4] | de54: e58d0004 str r0, [sp, #4] de58: e30030f8 movw r3, #248 @ 0xf8 | de58: e30030f8 movw r3, #248 @ 0xf8 de5c: e3423000 movt r3, #8192 @ 0x2000 | de5c: e3423000 movt r3, #8192 @ 0x2000 de60: e58d300c str r3, [sp, #12] | de60: e58d300c str r3, [sp, #12] de64: e59d1004 ldr r1, [sp, #4] | de64: e59d1004 ldr r1, [sp, #4] de68: e59d000c ldr r0, [sp, #12] | de68: e59d000c ldr r0, [sp, #12] de6c: ebfffe66 bl d80c <pl011_putc> | de6c: ebfffe66 bl d80c <pl011_putc> de70: e59d3004 ldr r3, [sp, #4] | de70: e28dd014 add sp, sp, #20 de74: e1a0000 mov r0, r3 | de74: e49df004 pop {pc} @ (ldr pc, [sp], #4) de78: e28dd014 add sp, sp, #20 | de7c: e49df004 pop {pc} @ (ldr pc, [sp], #4) | Signed-off-by: chao an <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Historically, the loopback driver used the largest packet size of all enabled link layer protocols. This permitted packets to be forwarded via the loopbak device with no major loss of performance. However, in experimenting with configurations where no other link layer protocols were enabled, this means the loopback packet size was set to the smallest possible size, to the SLIP minimum of 296 bytes. This resulted in terrible loopback performance.
This commit adds an option to increase the loopback packet size with the option CONFIG_NET_LOOPBACK_PACKETSIZE.
The loopback driver packet buffer should be quite large. The larger the loopback packet buffer, the better will be TCP performance of the loopback transfers. The Linux loopback device historically used packet buffers of size 16Kb, but that was increased in recent Linux versions to 64Kb. Those sizes may be excessive for resource constrained MCUs, however.
The network still enforces the lower limit that is the maximum packet size of all enabled link layer protocols. But this new option permits the loopback packet size to be increased from that.