mirror of
https://github.com/apache/nuttx.git
synced 2026-05-25 01:39:44 +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:
@@ -57,11 +57,12 @@
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_NET_IPv4
|
||||
void netdev_ipv4_txnotify(in_addr_t lipaddr, in_addr_t ripaddr)
|
||||
void netdev_ipv4_txnotify(in_addr_t lipaddr, in_addr_t ripaddr,
|
||||
uint32_t polltype)
|
||||
{
|
||||
/* Find the device driver that serves the subnet of the remote address */
|
||||
|
||||
netdev_txnotify_dev(netdev_findby_ripv4addr(lipaddr, ripaddr));
|
||||
netdev_txnotify_dev(netdev_findby_ripv4addr(lipaddr, ripaddr), polltype);
|
||||
}
|
||||
#endif /* CONFIG_NET_IPv4 */
|
||||
|
||||
@@ -83,11 +84,12 @@ void netdev_ipv4_txnotify(in_addr_t lipaddr, in_addr_t ripaddr)
|
||||
|
||||
#ifdef CONFIG_NET_IPv6
|
||||
void netdev_ipv6_txnotify(FAR const net_ipv6addr_t lipaddr,
|
||||
FAR const net_ipv6addr_t ripaddr)
|
||||
FAR const net_ipv6addr_t ripaddr,
|
||||
uint32_t polltype)
|
||||
{
|
||||
/* Find the device driver that serves the subnet of the remote address */
|
||||
|
||||
netdev_txnotify_dev(netdev_findby_ripv6addr(lipaddr, ripaddr));
|
||||
netdev_txnotify_dev(netdev_findby_ripv6addr(lipaddr, ripaddr), polltype);
|
||||
}
|
||||
#endif /* CONFIG_NET_IPv6 */
|
||||
|
||||
@@ -107,10 +109,14 @@ void netdev_ipv6_txnotify(FAR const net_ipv6addr_t lipaddr,
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void netdev_txnotify_dev(FAR struct net_driver_s *dev)
|
||||
void netdev_txnotify_dev(FAR struct net_driver_s *dev, uint32_t polltype)
|
||||
{
|
||||
if (dev != NULL && dev->d_txavail != NULL)
|
||||
{
|
||||
/* Set the poll type flags */
|
||||
|
||||
dev->d_polltype |= polltype;
|
||||
|
||||
/* Notify the device driver that new TX data is available. */
|
||||
|
||||
dev->d_txavail(dev);
|
||||
|
||||
Reference in New Issue
Block a user