mirror of
https://github.com/apache/nuttx.git
synced 2026-05-23 23:28:29 +08:00
net/devif_poll: optimize device buffer alloc in txpoll
Allocate the device buffer only if the protocol really need to send data. not all protocols require the driver to prepare additional iob before sending, especially UDP, each iob reserves l2/l3 header in advance after prepare write buffer, net device could reuse this entry to send directly Signed-off-by: chao an <anchao@xiaomi.com>
This commit is contained in:
@@ -69,6 +69,7 @@ int netdev_iob_prepare(FAR struct net_driver_s *dev, bool throttled,
|
||||
|
||||
if (dev->d_iob == NULL)
|
||||
{
|
||||
nwarn("WARNING: IOB Prepare failed for dev %s!\n", dev->d_ifname);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user