lwip-devel
[Top][All Lists]
Advanced

[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: Mon, 27 Feb 2017 12:45:41 -0500 (EST)
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:51.0) Gecko/20100101 Firefox/51.0

Follow-up Comment #40, patch #8882 (project lwip):

Attached is two patches:

= 02-27-17-Vectorize-netconn_write-for-TCP.patch =

This is an updated version of my previous patch from a year ago.  To recap, it
adds a new netconn API that takes a set of vectors and then performs an atomic
write via lwip_netconn_do_writemore (which now has support to loop over the
set of vectors, calling tcp_write() for each vector, then tcp_output() (a
single time)

Notable changes are:

1) struct iovec is no longer used in other layers than sockets.  To provide
binary compatibility, I've defined a struct netvector which functions
identically except it has the const attribute (improves upon opengroup
omission)
2) IOV_MAX is defined.  This is an improvement that bounds checks that the
caller didn't provide more vectors than we can support.  Currently we are
limited to u16_t for the vector count in the netconn API.  I'm open to
reducing this to u8_t (255 vectors) if that is more appropriate for our goal
of being light weight.  My applications using sendmsg typically sends up to
10-15 vectors
3) I added support in do_writemore() to also loop around sending again if we
are can't finish the current vector due to 16-bit size limitations.  This
means if we have a vector greater then 65535 and a send buffer larger than
65535 we can correctly output the vector without having to wait for
poll/sent_tcp to be called for blocking or non-blocking ending up with a
partial write

I do have one TODO in the patch that I need some guidance on.  When
API_EVENT() is called with NETCONN_EVT_SENDMINUS, previously the len parameter
was sent.  It's unclear to me what this variable is communicating (the amount
that was last successfully sent before filling the buffer?).  It is un-used in
the sockets event callback.  I can't easily replace it with the new equivalent
(which is the current total amount sent, stored in msg.w.offset) because the
parameter is only 16-bits (msg.w.offset is size_t)

= 02-27-17-Added-sendmsg-tests-to-socket-examples.patch =

This patch adds support for testing sendmsg TCP/UDP functionality.  It doesn't
rely on any of the changes in the vectorize patch.  I originally developed it
with my first sendmsg patch, but we never got around to committing it.  I've
updated it for IPv6 support and would like to check it in if you guys can
review it

(file #39838, file #39839)
    _______________________________________________________

Additional Item Attachment:

File name: 02-27-17-Vectorize-netconn_write-for-TCP.patch Size:13 KB
File name: 02-27-17-Added-sendmsg-tests-to-socket-examples.patch Size:8 KB


    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/patch/?8882>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]