Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion net/bluetooth/bluetooth_sendmsg.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ static uint32_t bluetooth_sendto_eventhandler(FAR struct net_driver_s *dev,

/* Allocate an IOB to hold the frame data */

iob = net_ioballoc(true);
iob = net_ioballoc(false);
if (iob == NULL)
{
nwarn("WARNING: Failed to allocate IOB\n");
Expand Down
10 changes: 5 additions & 5 deletions net/devif/devif_filesend.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,14 @@ int devif_file_send(FAR struct net_driver_s *dev, FAR struct file *file,

/* Append the send buffer after device buffer */

if (len > iob_navail(true) * CONFIG_IOB_BUFSIZE ||
netdev_iob_prepare(dev, true, 0) != OK)
if (len > iob_navail(false) * CONFIG_IOB_BUFSIZE ||
netdev_iob_prepare(dev, false, 0) != OK)
{
ret = -ENOMEM;
goto errout;
}

iob_update_pktlen(dev->d_iob, target_offset, true);
iob_update_pktlen(dev->d_iob, target_offset, false);

ret = file_seek(file, offset, SEEK_SET);
if (ret < 0)
Expand All @@ -111,7 +111,7 @@ int devif_file_send(FAR struct net_driver_s *dev, FAR struct file *file,
{
if (iob->io_flink == NULL)
{
iob->io_flink = iob_tryalloc(true);
iob->io_flink = iob_tryalloc(false);
if (iob->io_flink == NULL)
{
ret = -ENOMEM;
Expand Down Expand Up @@ -144,7 +144,7 @@ int devif_file_send(FAR struct net_driver_s *dev, FAR struct file *file,
}
}

iob_update_pktlen(dev->d_iob, target_offset + len, true);
iob_update_pktlen(dev->d_iob, target_offset + len, false);

dev->d_sndlen = len;
return len;
Expand Down
2 changes: 1 addition & 1 deletion net/icmp/icmp_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ static uint16_t icmp_datahandler(FAR struct net_driver_s *dev,
/* Copy the ICMP message into the I/O buffer chain (without waiting) */

ret = iob_clone_partial(dev->d_iob, dev->d_iob->io_pktlen,
0, iob, 0, false, false);
0, iob, 0, true, false);
if (ret < 0)
{
iob_free_chain(iob);
Expand Down
2 changes: 1 addition & 1 deletion net/icmpv6/icmpv6_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ static uint16_t icmpv6_datahandler(FAR struct net_driver_s *dev,
/* Copy the ICMPv6 message into the I/O buffer chain (without waiting) */

ret = iob_clone_partial(dev->d_iob, dev->d_iob->io_pktlen,
iplen, iob, 0, false, false);
iplen, iob, 0, true, false);
if (ret < 0)
{
iob_free_chain(iob);
Expand Down
6 changes: 5 additions & 1 deletion net/netdev/netdev_iob.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,11 @@ int netdev_iob_prepare(FAR struct net_driver_s *dev, bool throttled,

if (dev->d_iob == NULL)
{
dev->d_iob = net_iobtimedalloc(throttled, timeout);
dev->d_iob = net_iobtimedalloc(false, timeout);
if (dev->d_iob == NULL && throttled)
{
dev->d_iob = net_iobtimedalloc(true, timeout);
}
}

if (dev->d_iob == NULL)
Expand Down
2 changes: 1 addition & 1 deletion net/pkt/pkt_netpoll.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@

static int psock_pkt_cansend(FAR struct pkt_conn_s *conn)
{
if (iob_navail(true) <= 0
if (iob_navail(false) <= 0
#if defined(CONFIG_NET_PKT_WRITE_BUFFERS) && CONFIG_NET_SEND_BUFSIZE > 0
|| iob_get_queue_size(&conn->write_q) >= conn->sndbufs
#endif
Expand Down
8 changes: 4 additions & 4 deletions net/pkt/pkt_sendmsg_buffered.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ ssize_t pkt_sendmsg(FAR struct socket *psock, FAR const struct msghdr *msg,

if (nonblock)
{
iob = iob_tryalloc(true);
iob = iob_tryalloc(false);
}
else
{
Expand All @@ -292,7 +292,7 @@ ssize_t pkt_sendmsg(FAR struct socket *psock, FAR const struct msghdr *msg,
}

iob_reserve(iob, CONFIG_NET_LL_GUARDSIZE);
iob_update_pktlen(iob, 0, true);
iob_update_pktlen(iob, 0, false);

/* Copy the user data into the write buffer. We cannot wait for
* buffer space if the socket was opened non-blocking.
Expand All @@ -305,7 +305,7 @@ ssize_t pkt_sendmsg(FAR struct socket *psock, FAR const struct msghdr *msg,

if (nonblock)
{
ret = iob_trycopyin(iob, buf, len, offset, true);
ret = iob_trycopyin(iob, buf, len, offset, false);
}
else
{
Expand All @@ -315,7 +315,7 @@ ssize_t pkt_sendmsg(FAR struct socket *psock, FAR const struct msghdr *msg,
*/

conn_dev_unlock(&conn->sconn, dev);
ret = iob_copyin(iob, buf, len, offset, true);
ret = iob_copyin(iob, buf, len, offset, false);
conn_dev_lock(&conn->sconn, dev);
}

Expand Down
4 changes: 2 additions & 2 deletions net/sixlowpan/sixlowpan_framelist.c
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ int sixlowpan_queue_frames(FAR struct radio_driver_s *radio,
* necessary.
*/

iob = net_ioballoc(true);
iob = net_ioballoc(false);
DEBUGASSERT(iob != NULL);

fptr = iob->io_data;
Expand Down Expand Up @@ -630,7 +630,7 @@ int sixlowpan_queue_frames(FAR struct radio_driver_s *radio,
* necessary.
*/

iob = net_ioballoc(true);
iob = net_ioballoc(false);
DEBUGASSERT(iob != NULL);

/* Initialize the IOB */
Expand Down
19 changes: 19 additions & 0 deletions net/tcp/tcp_recvwindow.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,25 @@ uint32_t tcp_get_recvwindow(FAR struct net_driver_s *dev,

recvwndo = tailroom + (niob_avail * CONFIG_IOB_BUFSIZE);
}
#if CONFIG_IOB_THROTTLE > 0
else if (conn->readahead == NULL)
{
/* Advertise maximum segment size for window edge if here is no
* available iobs on current "free" connection.
*
* Note: hopefully, a single mss-sized packet can be queued by
* the throttled=false case in tcp_datahandler().
*/

int niob_avail_no_throttle = iob_navail(false);

recvwndo = tcp_rx_mss(dev);
if (recvwndo > niob_avail_no_throttle * CONFIG_IOB_BUFSIZE)
{
recvwndo = niob_avail_no_throttle * CONFIG_IOB_BUFSIZE;
}
}
#endif
else /* niob_avail == 0 */
{
/* No IOBs are available.
Expand Down
2 changes: 1 addition & 1 deletion net/tcp/tcp_send_buffered.c
Original file line number Diff line number Diff line change
Expand Up @@ -1083,7 +1083,7 @@ static uint32_t psock_send_eventhandler(FAR struct net_driver_s *dev,
* the maximum size packet that would fit.
*/

if (sndlen > iob_navail(true) * CONFIG_IOB_BUFSIZE)
if (sndlen > iob_navail(false) * CONFIG_IOB_BUFSIZE)
{
nwarn("Running low on iobs, limiting packet size\n");
sndlen = CONFIG_IOB_BUFSIZE;
Expand Down
3 changes: 1 addition & 2 deletions net/udp/udp_callback.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,7 @@ static uint16_t udp_datahandler(FAR struct net_driver_s *dev,

conn_lock(&conn->sconn);
#if CONFIG_NET_RECV_BUFSIZE > 0
if (conn->readahead && conn->readahead->io_pktlen > conn->rcvbufs &&
iob_navail(true) == 0)
if (conn->readahead && conn->readahead->io_pktlen > conn->rcvbufs)
{
conn_unlock(&conn->sconn);
netdev_iob_release(dev);
Expand Down
8 changes: 4 additions & 4 deletions net/udp/udp_sendto_buffered.c
Original file line number Diff line number Diff line change
Expand Up @@ -832,7 +832,7 @@ ssize_t psock_udp_sendto(FAR struct socket *psock, FAR const void *buf,
udpiplen = udpip_hdrsize(conn);

iob_reserve(wrb->wb_iob, CONFIG_NET_LL_GUARDSIZE);
iob_update_pktlen(wrb->wb_iob, udpiplen, true);
iob_update_pktlen(wrb->wb_iob, udpiplen, false);

/* Copy the user data into the write buffer. We cannot wait for
* buffer space if the socket was opened non-blocking.
Expand All @@ -843,12 +843,12 @@ ssize_t psock_udp_sendto(FAR struct socket *psock, FAR const void *buf,
if (nonblock)
{
ret = iob_trycopyin(wrb->wb_iob, (FAR uint8_t *)buf,
len, udpiplen, true);
len, udpiplen, false);
}
else
{
ret = iob_copyin(wrb->wb_iob, (FAR uint8_t *)buf,
len, udpiplen, true);
len, udpiplen, false);
}

if (ret < 0)
Expand Down Expand Up @@ -951,7 +951,7 @@ int psock_udp_cansend(FAR struct udp_conn_s *conn)
* many more.
*/

if (udp_wrbuffer_test() < 0 || iob_navail(true) <= 0
if (udp_wrbuffer_test() < 0 || iob_navail(false) <= 0
#if CONFIG_NET_SEND_BUFSIZE > 0
|| udp_wrbuffer_inqueue_size(conn) >= conn->sndbufs
#endif
Expand Down
4 changes: 2 additions & 2 deletions net/udp/udp_wrbuffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ FAR struct udp_wrbuffer_s *udp_wrbuffer_alloc(void)

/* Now get the first I/O buffer for the write buffer structure */

wrb->wb_iob = net_ioballoc(true);
wrb->wb_iob = net_ioballoc(false);
if (!wrb->wb_iob)
{
nerr("ERROR: Failed to allocate I/O buffer\n");
Expand Down Expand Up @@ -205,7 +205,7 @@ FAR struct udp_wrbuffer_s *udp_wrbuffer_tryalloc(void)
#ifdef CONFIG_NET_JUMBO_FRAME
iob_alloc_dynamic(len);
#else
iob_tryalloc(true);
iob_tryalloc(false);
#endif
if (!wrb->wb_iob)
{
Expand Down
Loading