https://redmine.openinfosecfoundation.org/https://redmine.openinfosecfoundation.org/favicon.ico?17011170022020-05-12T08:58:37ZOpen Information Security FoundationSuricata - Task #3695: research: libhwloc for better autoconfigurationhttps://redmine.openinfosecfoundation.org/issues/3695?journal_id=163712020-05-12T08:58:37ZVictor Julienvictor@inliniac.net
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Assigned</i></li><li><strong>Assignee</strong> set to <i>Shivani Bhardwaj</i></li><li><strong>Target version</strong> set to <i>6.0.0beta1</i></li></ul> Suricata - Task #3695: research: libhwloc for better autoconfigurationhttps://redmine.openinfosecfoundation.org/issues/3695?journal_id=165302020-06-01T14:29:15ZVictor Julienvictor@inliniac.net
<ul><li><strong>Target version</strong> changed from <i>6.0.0beta1</i> to <i>7.0.0-beta1</i></li></ul> Suricata - Task #3695: research: libhwloc for better autoconfigurationhttps://redmine.openinfosecfoundation.org/issues/3695?journal_id=182442020-11-07T07:42:08ZVictor Julienvictor@inliniac.net
<ul><li><strong>Related to</strong> <i><a class="issue tracker-5 status-1 priority-4 priority-default" href="/issues/3318">Task #3318</a>: Research: NUMA awareness</i> added</li></ul> Suricata - Task #3695: research: libhwloc for better autoconfigurationhttps://redmine.openinfosecfoundation.org/issues/3695?journal_id=195262021-03-11T08:23:54ZShivani Bhardwaj
<ul></ul><p>As of May 2020, on hwloc v2.2.0, there were following findings based on the goals defined for this task.</p>
<pre>
Available components
Linux: official component for discovering CPU, memory and I/O devices in linux. It discovers PCI devices without the help of external libraries such as libpciaccess but requires the pci component for adding vendor/device names to PCI objects. It also discovers many kinds of linux specific OR devices.
Aix, darwin, freeBSD, NetBSD, Solaris, Windows: Each officially supported OS has its own native component which is statically built when supported and which is used by default.
A lot more available on https://www-lb.open-mpi.org/projects/hwloc/doc/v2.0.1/a00324.php#plugins_list
Integration with Suricata
- On Linux, it seems to work. There is an elaborate API provided by Hwloc that can be used to access all nodes of the topology.
- The PoC checks for hwloc library’s presence on the system if configured with --enable-hwloc option
- Looks for the one and only interface that Suricata is currently using
- Looks for NUMA nodes attached to that interface and prints out “FOUND THE NUMA node”
</pre>
<p>Code for the topology on my then system can be found here: <a class="external" href="https://github.com/inashivb/suricata/tree/hwloc-poc/v1">https://github.com/inashivb/suricata/tree/hwloc-poc/v1</a></p>
<p>Victor took a look at this and modified some parts to make it work on the topology of his system. The relevant conversation was:</p>
<pre>
=Victor Julien=
So what I did was very generic I think: find the NIC and walk back until we find the package. That then knows the numa id
=Shivani Bhardwaj=
yeah but if its the machine as was in my case there's nothing to walk back to
i don't know if there can be any more topology structures than these
=Victor Julien=
not even a machine or package?
=Shivani Bhardwaj=
Machine is the root so we walk down from there
=Victor Julien=
I think the reverse makes more sense. Use the search func to find the pci id, then walk backwards towards the parents
=Victor Julien=
Maybe we can just:
$ cat /sys/class/net/enp8s0/device/numa_node
0
instead...
=Shivani Bhardwaj=
Hmm not sure why I get -1 there
=Victor Julien=
I don't get it, on another box I see
HostBridge L#0
PCIBridge
PCI 144d:a801
Block(Disk) L#0 "sdb"
PCIBridge
PCI 10de:1c03
GPU L#1 "renderD128"
GPU L#2 "card0"
PCI 8086:2827
PCI 8086:15a0
Net L#3 "eth0"
this I want everywhere
</pre> Suricata - Task #3695: research: libhwloc for better autoconfigurationhttps://redmine.openinfosecfoundation.org/issues/3695?journal_id=200762021-06-08T08:13:02ZShivani Bhardwaj
<ul><li><strong>Priority</strong> changed from <i>Normal</i> to <i>Low</i></li></ul> Suricata - Task #3695: research: libhwloc for better autoconfigurationhttps://redmine.openinfosecfoundation.org/issues/3695?journal_id=206572021-09-15T07:23:37ZVictor Julienvictor@inliniac.net
<ul><li><strong>Target version</strong> changed from <i>7.0.0-beta1</i> to <i>8.0.0-beta1</i></li></ul> Suricata - Task #3695: research: libhwloc for better autoconfigurationhttps://redmine.openinfosecfoundation.org/issues/3695?journal_id=209332021-10-11T12:42:00ZShivani Bhardwaj
<ul><li><strong>Priority</strong> changed from <i>Low</i> to <i>High</i></li></ul> Suricata - Task #3695: research: libhwloc for better autoconfigurationhttps://redmine.openinfosecfoundation.org/issues/3695?journal_id=237202022-06-07T12:44:25ZVictor Julienvictor@inliniac.net
<ul><li><strong>Priority</strong> changed from <i>High</i> to <i>Normal</i></li></ul>