[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-devel] [patch #8882] Vector improvements
From: |
Joel Cunningham |
Subject: |
[lwip-devel] [patch #8882] Vector improvements |
Date: |
Thu, 7 Jul 2016 13:29:08 +0000 (UTC) |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:47.0) Gecko/20100101 Firefox/47.0 |
Follow-up Comment #14, patch #8882 (project lwip):
Simon,
I like the idea of treating the set of vectors the same for both UDP and TCP
but I think adding support for TCP sending to lwip_netconn_do_send() is going
to be complicated if we don't use/re-use logic from
lwip_netconn_do_writemore()
do_writemore() has all the infrastructure to block the caller during a partial
write and then callback during poll_tcp() and sent_tcp() to continue sending.
Non-blocking would be easy, as we just return the partial number of bytes,
it's the blocking that is challenging.
What do you think about modifying lwip_netconn_do_writemore() to use a netbuf
pointer instead of a void *? We currently have the following state in struct
api_msg:
/** used for lwip_netconn_do_write */
struct {
const void *dataptr;
size_t len;
u8_t apiflags;
#if LWIP_SO_SNDTIMEO
u32_t time_started;
#endif /* LWIP_SO_SNDTIMEO */
} w;
Since the netbuf would be on the callers stack, we wouldn't need to increase
the size of struct api_msg. We could then modify lwip_netconn_do_writemore()
to operate on a netbuf containing one or more pbufs. I think the only thing
that would change in the normal send case is that netconn_write_partly() would
need to assign dataptr to a netbuf via netbuf_ref() (like is currently done
for UDP sendto)
This work would also start laying the ground work for having tcp_write()
accept pbufs directly as we'd already have the top end working with pbufs,
then later tcp_write could be improved to also support pbufs.
_______________________________________________________
Reply to this item at:
<http://savannah.nongnu.org/patch/?8882>
_______________________________________________
Message sent via/by Savannah
http://savannah.nongnu.org/