-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Fixed USB RNDIS not to send over MTU packet #188
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
Fixed USB RNDIS not to send over MTU packet #188
Conversation
USB RNDIS sent the packet which has CONFIG_ETH_PKTSIZE + CONFIG_NET_GUARDSIZE. The maximum size of Ethernet packet should be CONFIG_ETH_PKTSIZE. Signed-off-by: Koichi Okamoto <Koichi.Okamoto@sony.com>
|
No, that is the way that the packet size is configured for all network drivers. We will not make an exception here. The GUARD_SIZE is configurable. If you want it to be zero set it to zero in your configuration. |
|
But GUARD_SIZE is global option, how to handle the case that both ethernet(require guard bytes) driver and rndis driver enable? |
|
There is a lot more that we would need to discuss to decide what to do with CONFIG_NET_GUARDSIZE. Currently it is a very small value, defaulting to only two bytes. So it is not a memory hog and the simplest response is to keep it present in all drivers for commonality. It should (eventually) be larger and common for all drivers. We need to look at how it is used today and how it might be used tomorrow. There is a probably a lot more involved that you are considering. It is not just for hardware packet receipt: For packet receipt, it is necessary for some hardware, but not others. Often the hardware will DMA 2 byte FCS at the end of the package, or other hardware-specific info. That is the driver-specific part that you are considering but that is only part of the whole story. There are several issues for packet transmission. These are less well defined and need further study, but we need to keep all of the driver packet definitions in place until we understand how we are going to handle these things:
I do no know if we have any such bugs today. Perhaps they do? Perhaps they do not? Having such a guard is a good thing for reliability in any case.
The problem is, of course, is that IPv4/IPv6 and TCP headers are not constant. Using the minimum size for these headers precludes using IPv4/IPv6 or TCP header options. There are currenly only a few places where options are required and these haveto be handled as special cases. This needs to be formalized into the common packet formatting logic. Otherwise, the network will never be able to handle advanced features like tunneling or NAT. I am thinking that this should be like:
The key to making this all work is:
|
|
I just put the above information into a Wiki page at: https://cwiki.apache.org/confluence/display/NUTTX/CONFIG_NET_GUARDSIZE |
|
Thank you for your discussion with CONFIG_NET_GUARDSIZE. Does each of drivers have the responsibility of the limitation of ethernet packet length? It seems to me that CONFIG_NET_GUARDSIZE is the spirit of uIP. I am not sure but Upon reconsidering the matter, driver level modification such as USB RNDIS can limit I will also discuss the lack of error handling of rndis_fillrequest() return 0 (Ethernet length is 0 and over CONFIG_NET_ETH_PKTSIZE). In this case,there is no RNDIS BULKIN header. I choose EINVAL in this case. Is this reasonable modification? |
… warnings "/mnt/yang/qixinwei_cmake/nuttx/sched/sched/sched_removeblocked.c", line 58: warning apache#188-D: enumerated type mixed with another type tstate_t task_state = btcb->task_state; "/mnt/yang/qixinwei_cmake/nuttx/sched/sched/sched_setpriority.c", line 243: warning apache#188-D: enumerated type mixed with another type tstate_t task_state = tcb->task_state; Signed-off-by: yanghuatao <yanghuatao@xiaomi.com>
… warnings "/mnt/yang/qixinwei_cmake/nuttx/sched/sched/sched_removeblocked.c", line 58: warning apache#188-D: enumerated type mixed with another type tstate_t task_state = btcb->task_state; "/mnt/yang/qixinwei_cmake/nuttx/sched/sched/sched_setpriority.c", line 243: warning apache#188-D: enumerated type mixed with another type tstate_t task_state = tcb->task_state; Signed-off-by: yanghuatao <yanghuatao@xiaomi.com>
… warnings "/mnt/yang/qixinwei_cmake/nuttx/sched/sched/sched_removeblocked.c", line 58: warning apache#188-D: enumerated type mixed with another type tstate_t task_state = btcb->task_state; "/mnt/yang/qixinwei_cmake/nuttx/sched/sched/sched_setpriority.c", line 243: warning apache#188-D: enumerated type mixed with another type tstate_t task_state = tcb->task_state; Signed-off-by: yanghuatao <yanghuatao@xiaomi.com>
CC: obstack/lib_obstack_printf.c "mmap/fs_rammap.c", line 126: warning apache#188-D: enumerated type mixed with another type enum mm_map_type_e type = (uintptr_t)entry->priv.p & 3; ^ Signed-off-by: guoshichao <guoshichao@xiaomi.com>
"net/netdev_upperhalf.c", line 133: warning apache#188-D: enumerated type mixed with another type total += netdev_lower_quota_load(lower, type); CC: dirent/lib_alphasort.c "spi/spi_transfer.c", line 83: warning apache#188-D: enumerated type mixed with another type SPI_SETMODE(spi, seq->mode); ^ Signed-off-by: guoshichao <guoshichao@xiaomi.com>
CC: irq/irq_initialize.c "ioexpander/gpio.c", line 386: warning apache#188-D: enumerated type mixed with another type *ptr = dev->gp_pintype; ^ Signed-off-by: guoshichao <guoshichao@xiaomi.com>
"net/netdev_upperhalf.c", line 133: warning apache#188-D: enumerated type mixed with another type total += netdev_lower_quota_load(lower, type); CC: dirent/lib_alphasort.c "spi/spi_transfer.c", line 83: warning apache#188-D: enumerated type mixed with another type SPI_SETMODE(spi, seq->mode); ^ Signed-off-by: guoshichao <guoshichao@xiaomi.com>
CC: irq/irq_initialize.c "ioexpander/gpio.c", line 386: warning apache#188-D: enumerated type mixed with another type *ptr = dev->gp_pintype; ^ Signed-off-by: guoshichao <guoshichao@xiaomi.com>
"net/netdev_upperhalf.c", line 133: warning #188-D: enumerated type mixed with another type total += netdev_lower_quota_load(lower, type); CC: dirent/lib_alphasort.c "spi/spi_transfer.c", line 83: warning #188-D: enumerated type mixed with another type SPI_SETMODE(spi, seq->mode); ^ Signed-off-by: guoshichao <guoshichao@xiaomi.com>
CC: irq/irq_initialize.c "ioexpander/gpio.c", line 386: warning #188-D: enumerated type mixed with another type *ptr = dev->gp_pintype; ^ Signed-off-by: guoshichao <guoshichao@xiaomi.com>
"net/netdev_upperhalf.c", line 133: warning apache#188-D: enumerated type mixed with another type total += netdev_lower_quota_load(lower, type); CC: dirent/lib_alphasort.c "spi/spi_transfer.c", line 83: warning apache#188-D: enumerated type mixed with another type SPI_SETMODE(spi, seq->mode); ^ Signed-off-by: guoshichao <guoshichao@xiaomi.com>
CC: irq/irq_initialize.c "ioexpander/gpio.c", line 386: warning apache#188-D: enumerated type mixed with another type *ptr = dev->gp_pintype; ^ Signed-off-by: guoshichao <guoshichao@xiaomi.com>
… warnings "/mnt/yang/qixinwei_cmake/nuttx/sched/sched/sched_removeblocked.c", line 58: warning apache#188-D: enumerated type mixed with another type tstate_t task_state = btcb->task_state; "/mnt/yang/qixinwei_cmake/nuttx/sched/sched/sched_setpriority.c", line 243: warning apache#188-D: enumerated type mixed with another type tstate_t task_state = tcb->task_state; Signed-off-by: yanghuatao <yanghuatao@xiaomi.com>
… warnings "/mnt/yang/qixinwei_cmake/nuttx/sched/sched/sched_removeblocked.c", line 58: warning #188-D: enumerated type mixed with another type tstate_t task_state = btcb->task_state; "/mnt/yang/qixinwei_cmake/nuttx/sched/sched/sched_setpriority.c", line 243: warning #188-D: enumerated type mixed with another type tstate_t task_state = tcb->task_state; Signed-off-by: yanghuatao <yanghuatao@xiaomi.com>
"net/netdev_upperhalf.c", line 133: warning apache#188-D: enumerated type mixed with another type total += netdev_lower_quota_load(lower, type); CC: dirent/lib_alphasort.c "spi/spi_transfer.c", line 83: warning apache#188-D: enumerated type mixed with another type SPI_SETMODE(spi, seq->mode); ^ Signed-off-by: guoshichao <guoshichao@xiaomi.com>
CC: irq/irq_initialize.c "ioexpander/gpio.c", line 386: warning apache#188-D: enumerated type mixed with another type *ptr = dev->gp_pintype; ^ Signed-off-by: guoshichao <guoshichao@xiaomi.com>
… warnings "/mnt/yang/qixinwei_cmake/nuttx/sched/sched/sched_removeblocked.c", line 58: warning apache#188-D: enumerated type mixed with another type tstate_t task_state = btcb->task_state; "/mnt/yang/qixinwei_cmake/nuttx/sched/sched/sched_setpriority.c", line 243: warning apache#188-D: enumerated type mixed with another type tstate_t task_state = tcb->task_state; Signed-off-by: yanghuatao <yanghuatao@xiaomi.com>
CC: obstack/lib_obstack_printf.c "mmap/fs_rammap.c", line 126: warning apache#188-D: enumerated type mixed with another type enum mm_map_type_e type = (uintptr_t)entry->priv.p & 3; ^ Signed-off-by: guoshichao <guoshichao@xiaomi.com>
CC: obstack/lib_obstack_printf.c "mmap/fs_rammap.c", line 126: warning #188-D: enumerated type mixed with another type enum mm_map_type_e type = (uintptr_t)entry->priv.p & 3; ^ Signed-off-by: guoshichao <guoshichao@xiaomi.com>
"net/netdev_upperhalf.c", line 133: warning apache#188-D: enumerated type mixed with another type total += netdev_lower_quota_load(lower, type); CC: dirent/lib_alphasort.c "spi/spi_transfer.c", line 83: warning apache#188-D: enumerated type mixed with another type SPI_SETMODE(spi, seq->mode); ^ Signed-off-by: guoshichao <guoshichao@xiaomi.com>
CC: irq/irq_initialize.c "ioexpander/gpio.c", line 386: warning apache#188-D: enumerated type mixed with another type *ptr = dev->gp_pintype; ^ Signed-off-by: guoshichao <guoshichao@xiaomi.com>
… warnings "/mnt/yang/qixinwei_cmake/nuttx/sched/sched/sched_removeblocked.c", line 58: warning apache#188-D: enumerated type mixed with another type tstate_t task_state = btcb->task_state; "/mnt/yang/qixinwei_cmake/nuttx/sched/sched/sched_setpriority.c", line 243: warning apache#188-D: enumerated type mixed with another type tstate_t task_state = tcb->task_state; Signed-off-by: yanghuatao <yanghuatao@xiaomi.com>
CC: obstack/lib_obstack_printf.c "mmap/fs_rammap.c", line 126: warning apache#188-D: enumerated type mixed with another type enum mm_map_type_e type = (uintptr_t)entry->priv.p & 3; ^ Signed-off-by: guoshichao <guoshichao@xiaomi.com>
USB RNDIS sent the packet which has
CONFIG_ETH_PKTSIZE + CONFIG_NET_GUARDSIZE.
The maximum size of Ethernet packet should be CONFIG_ETH_PKTSIZE.
Signed-off-by: Koichi Okamoto Koichi.Okamoto@sony.com