mirror of
https://github.com/apache/nuttx.git
synced 2026-05-28 11:56:10 +08:00
devif_poll: only call the corresponding xxx_poll when there is data to be sent
reduce the execution consumption of irrelevant code testing the TX rates of TCP and UDP based on the Infineon board can increase them by 13%. Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
This commit is contained in:
@@ -133,7 +133,7 @@ static uint32_t send_eventhandler(FAR struct net_driver_s *dev,
|
||||
|
||||
if ((flags & WPAN_NEWDATA) == 0)
|
||||
{
|
||||
DEBUGASSERT((flags & WPAN_POLL) != 0);
|
||||
DEBUGASSERT((flags & UDP_POLL) != 0);
|
||||
|
||||
/* Transfer the frame list to the IEEE802.15.4 MAC device */
|
||||
|
||||
@@ -142,7 +142,7 @@ static uint32_t send_eventhandler(FAR struct net_driver_s *dev,
|
||||
sinfo->s_ipv6hdr, sinfo->s_buf, sinfo->s_len,
|
||||
sinfo->s_destmac);
|
||||
|
||||
flags &= ~WPAN_POLL;
|
||||
flags &= ~UDP_POLL;
|
||||
neighbor_reachable(dev);
|
||||
goto end_wait;
|
||||
}
|
||||
@@ -239,13 +239,13 @@ int sixlowpan_send(FAR struct net_driver_s *dev,
|
||||
|
||||
/* Set up the callback in the connection */
|
||||
|
||||
sinfo.s_cb->flags = (NETDEV_DOWN | WPAN_POLL);
|
||||
sinfo.s_cb->flags = (NETDEV_DOWN | UDP_POLL);
|
||||
sinfo.s_cb->priv = (FAR void *)&sinfo;
|
||||
sinfo.s_cb->event = send_eventhandler;
|
||||
|
||||
/* Notify the IEEE802.15.4 MAC that we have data to send. */
|
||||
|
||||
netdev_txnotify_dev(dev);
|
||||
netdev_txnotify_dev(dev, UDP_POLL);
|
||||
|
||||
/* Wait for the send to complete or an error to occur.
|
||||
* net_sem_timedwait will also terminate if a signal is received.
|
||||
|
||||
@@ -628,7 +628,7 @@ static int sixlowpan_send_packet(FAR struct socket *psock,
|
||||
/* Set up the callback in the connection */
|
||||
|
||||
sinfo.s_cb->flags = (NETDEV_DOWN | TCP_ACKDATA | TCP_REXMIT |
|
||||
TCP_DISCONN_EVENTS | WPAN_POLL);
|
||||
TCP_DISCONN_EVENTS | TCP_POLL);
|
||||
sinfo.s_cb->priv = (FAR void *)&sinfo;
|
||||
sinfo.s_cb->event = tcp_send_eventhandler;
|
||||
|
||||
@@ -640,7 +640,7 @@ static int sixlowpan_send_packet(FAR struct socket *psock,
|
||||
|
||||
/* Notify the IEEE802.15.4 MAC that we have data to send. */
|
||||
|
||||
netdev_txnotify_dev(dev);
|
||||
netdev_txnotify_dev(dev, TCP_POLL);
|
||||
|
||||
/* Wait for the send to complete or an error to occur.
|
||||
* net_sem_timedwait will also terminate if a signal is received.
|
||||
|
||||
Reference in New Issue
Block a user