Sorry for not answering that post, I meant to, but somehow it slipped through...
Mason <[email protected]> wrote: > > I don't think it's possible to use mem_malloc as a packet > > buffer allocator, as there are other types of uses, e.g. > > > > dhcp = (struct dhcp *)mem_malloc(sizeof(struct dhcp)); > > autoip = (struct autoip *)mem_malloc(sizeof(struct autoip)); These are not used if you init autoip and dhcp correctly (dhcp_set_struct(), autoip_set_struct()). I know that's not a good solution and we should add pools for it. > > What I'd like is to be able to "redirect" pbuf_alloc to use > > my buffer allocator, but the pbuf struct and the payload buffer > > would not be contiguous, which violates the implicit assumptions > > of PBUF_RAM pbufs, IIUC. > > > > Have things changed on that front? No, not yet. What's missing there are two things: a) redirecting pbuf_alloc() to a custom function and b) having a PBUF_REF-like type where pbuf_header works in both directions. It shouldn't be too hard to implement, but I haven't even found the time to work much on the 1.4.1 release-related things, lately, so it might take some time until we get there :-( > > If no, that means I have to memcpy every outgoing frame, right? Not if would redirect mem_malloc(). However, your platform would need to allow the pbuf struct and payload be in contiguous memory, then. > I did find this information on the lwip wiki > http://lwip.wikia.com/wiki/Writing_a_device_driver#Notes_on_Zero-Copy_Network_interface_drivers > > But I think it's a little bit dated? Yeah, that doesn't really sum it up right. I don't think I have ever seen that article before... Simon -- Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de _______________________________________________ lwip-users mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/lwip-users
