lwIP - A Lightweight TCP/IP stack - Bugs: bug #54546, RAW API ethernet_input does not...
You are not allowed to post comments on this tracker with your current authentication level.
bug #54546: RAW API ethernet_input does not support pbuf chains
Submitter: | Yonatan Shkolnik <yonatans> | ||
Submitted: | Tue 21 Aug 2018 02:36:54 PM UTC | ||
Category: | pbufs | Severity: | 3 - Normal |
Item Group: | Faulty Behaviour | Status: | Wont Fix |
Privacy: | Public | Assigned to: | None |
Open/Closed: | Closed | Planned Release: | None |
lwIP version: | 2.0.3 |
Jump to the original submission
Thu 23 Aug 2018 07:44:38 AM UTC, comment #11: |
Yonatan Shkolnik <yonatans> |
Wed 22 Aug 2018 09:04:22 PM UTC, comment #10: I don't think we will change anything around here in the near future. But to know what the requirements could be, could you tell us where your hardware splits packets? Optimizing for (zero copy) hardware is on the list, though not at all cost... |
Simon Goldschmidt <goldsimon> |
Wed 22 Aug 2018 01:15:55 PM UTC, comment #9: Note that you don't need to copy everything into one pbuf, only the first pbuf must be filled with continuous data at least to the default value of PBUF_POOL_BUFSIZE. |
Sylvain Rochet <gradator> |
Tue 21 Aug 2018 10:54:52 PM UTC, comment #8: OK, thanks for the quick response. You should close the bug. |
Yonatan Shkolnik <yonatans> |
Tue 21 Aug 2018 10:50:00 PM UTC, comment #7: Yes. AFAIK lwIP does not support highly fragmented scatter-gather packet input. |
Sylvain Rochet <gradator> |
Tue 21 Aug 2018 10:33:26 PM UTC, comment #6: So if my hardware splits the header/data into separate buffers, I am doomed to copy them into one pbuf before using ethernet_input? |
Yonatan Shkolnik <yonatans> |
Tue 21 Aug 2018 10:15:29 PM UTC, comment #5: Well, ARP packet must fit into the first pbuf then, this is always the case if IP, UDP/TCP/ICMP headers fit isn't it ?
|
Sylvain Rochet <gradator> |
Tue 21 Aug 2018 10:09:06 PM UTC, comment #4: As I said, even when all of the headers of the packet are in the same pbuf, it still doesn't function. If you take the simplest example, ARP packet, then you can clearly see that it immediately fails since the header packet is immediately compared to ethernet header size and fails (since ethernet header is not bigger than ethernet header size). These functions never use p->next anyway, so they can never reach any of the pbufs besides the first one. |
Yonatan Shkolnik <yonatans> |
Tue 21 Aug 2018 10:01:48 PM UTC, comment #3: ICMP headers must fit into the first pbuf as well. |
Sylvain Rochet <gradator> |
Tue 21 Aug 2018 09:51:51 PM UTC, comment #2: Even when there are 2 pbufs where 1 contains the L2/L3/L4 header and the second conatins the payload, the code will still not work as expected since the next functions (icmp_input for example) never uses p->next, and thus, thinks they receive no payload. |
Yonatan Shkolnik <yonatans> |
Tue 21 Aug 2018 09:19:38 PM UTC, comment #1: As per lwIP design to reduce code footprint, Ethernet, IP, and UDP/TCP headers must fit into the first pbuf. Should we close the bug then ? |
Sylvain Rochet <gradator> |
Tue 21 Aug 2018 02:36:54 PM UTC, original submission:
Passing a pbuf chain to ethernet_input (src/netif/ethernet.c) will not work as the function assumes the packet is stored in one pbuf (for example, checks (p->len <= SIZEOF_ETH_HDR) instead of comparing p->tot_len, and assuming that the next header offsets are on the same pbuf. |
Yonatan Shkolnik <yonatans> |
No files currently attached
Depends on the following items: None found
Items that depend on this one: None found
There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
Follow 6 latest changes.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2018-08-22 | gradator | Status | Need Info | Wont Fix | |
Open/Closed | Open | Closed | |||
2018-08-21 | gradator | Category | None | pbufs | |
Status | None | Need Info | |||
2018-08-21 | yonatans | Carbon-Copy | - | Added yonatans | |
Carbon-Copy | - | Added -email is unavailable- |
Powered by Savane 3.13-f8d8.
Corresponding source code
The hardware split the header/payload of the packets for Ethernet/IP/TCP/UDP meaning the an ARP packet would have 1 buffer of Ethernet header and 1 buffer for Ethernet payload. An ICMP packet would have 1 buffer containing Ethernet/IP header and 1 buffer for IP payload. A UDP packet would have 1 buffer containing Ethernet/IP/UDP header and 1 buffer containing UDP payload.
I hope the explanation makes sense.