Commit 7567f01
libnvme: Add nvme_getifaddrs()
The POSIX `getifaddrs()` API returns the list of network
interfaces on the system, but invoking it can be costly. On
large-scale systems with hundreds of NVMe-over-TCP connections,
this API may be called hundreds of times, resulting in increased
latency.
This patch introduces `nvme_getifaddrs()`, a wrapper around
`getifaddrs()` that caches the results on the first invocation
and reuses the cached data on subsequent calls.
Signed-off-by: Martin Belanger <[email protected]>1 parent 5be98d6 commit 7567f01
3 files changed
Lines changed: 44 additions & 26 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
| |||
273 | 275 | | |
274 | 276 | | |
275 | 277 | | |
| 278 | + | |
276 | 279 | | |
277 | 280 | | |
278 | 281 | | |
| |||
552 | 555 | | |
553 | 556 | | |
554 | 557 | | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
555 | 572 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| |||
525 | 525 | | |
526 | 526 | | |
527 | 527 | | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
528 | 531 | | |
529 | 532 | | |
530 | 533 | | |
| |||
1756 | 1759 | | |
1757 | 1760 | | |
1758 | 1761 | | |
1759 | | - | |
| 1762 | + | |
| 1763 | + | |
1760 | 1764 | | |
1761 | 1765 | | |
1762 | 1766 | | |
| |||
1786 | 1790 | | |
1787 | 1791 | | |
1788 | 1792 | | |
1789 | | - | |
1790 | | - | |
1791 | | - | |
1792 | | - | |
1793 | | - | |
1794 | | - | |
| 1793 | + | |
1795 | 1794 | | |
1796 | 1795 | | |
1797 | 1796 | | |
| |||
1806 | 1805 | | |
1807 | 1806 | | |
1808 | 1807 | | |
1809 | | - | |
1810 | | - | |
1811 | | - | |
1812 | | - | |
1813 | | - | |
1814 | | - | |
1815 | | - | |
1816 | | - | |
1817 | | - | |
1818 | | - | |
1819 | | - | |
1820 | | - | |
1821 | 1808 | | |
1822 | 1809 | | |
1823 | 1810 | | |
1824 | 1811 | | |
1825 | 1812 | | |
1826 | | - | |
| 1813 | + | |
1827 | 1814 | | |
1828 | 1815 | | |
1829 | 1816 | | |
1830 | 1817 | | |
1831 | | - | |
1832 | | - | |
| 1818 | + | |
| 1819 | + | |
| 1820 | + | |
1833 | 1821 | | |
1834 | 1822 | | |
1835 | 1823 | | |
| |||
1847 | 1835 | | |
1848 | 1836 | | |
1849 | 1837 | | |
1850 | | - | |
| 1838 | + | |
1851 | 1839 | | |
1852 | 1840 | | |
1853 | 1841 | | |
1854 | | - | |
1855 | | - | |
| 1842 | + | |
| 1843 | + | |
| 1844 | + | |
1856 | 1845 | | |
1857 | 1846 | | |
1858 | 1847 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1167 | 1167 | | |
1168 | 1168 | | |
1169 | 1169 | | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
| 1178 | + | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
0 commit comments