Skip to content

Commit 776a6a5

Browse files
zs39acassis
authored andcommitted
netlib: Add IOB statistics interface description
Includes an introduction to the interface, and details about the input parameters and return values. Signed-off-by: zhangshuai39 <[email protected]>
1 parent cdaf4ee commit 776a6a5

File tree

1 file changed

+33
-0
lines changed
  • Documentation/applications/netutils/netlib

1 file changed

+33
-0
lines changed

Documentation/applications/netutils/netlib/index.rst

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,39 @@ Network Interface Management
306306
:return: 0 if no conflict is detected; 1 if a conflict is detected; a negative
307307
value on error with ``errno`` set appropriately.
308308
309+
Network Buffer Statistics
310+
==========================
311+
312+
- :c:func:`netlib_get_iobinfo`
313+
314+
.. c:function:: int netlib_get_iobinfo(struct iob_stats_s *iob)
315+
316+
Get the network IOB (I/O Buffer) statistics. This function reads IOB usage
317+
information from the procfs file system (``/proc/iobinfo``) which provides
318+
details about the network packet buffer pool.
319+
320+
IOB buffers are used by the NuttX network stack to buffer network packets
321+
during transmission and reception. This function allows monitoring the IOB
322+
buffer pool to detect potential buffer exhaustion or throttling conditions.
323+
324+
:param iob: Pointer to an ``iob_stats_s`` structure to receive the IOB
325+
statistics. The structure contains the following fields:
326+
327+
- ``ntotal``: Total number of IOB buffers configured
328+
(``CONFIG_IOB_NBUFFERS``)
329+
- ``nfree``: Current number of free IOB buffers available
330+
- ``nwait``: Number of tasks waiting for IOB buffers (when
331+
``nfree < 0``)
332+
- ``nthrottle``: Number of IOB buffers that are throttled (when
333+
below ``CONFIG_IOB_THROTTLE`` threshold)
334+
335+
:return: 0 on success; a negative value on failure with ``errno`` set
336+
appropriately.
337+
338+
**Note:** This function requires ``CONFIG_MM_IOB`` to be enabled. The IOB
339+
statistics are provided by the kernel's IOB buffer management system and
340+
reflect the current state of the network packet buffer pool.
341+
309342
ARP Table Support
310343
==================
311344

0 commit comments

Comments
 (0)