On Linux, a Myricom network adapter by default works as a regular network
interface using the myri10ge.ko
kernel module. To support such interfaces,
libpcap does not require any additional setup and the rest of this document
does not apply.
It is also possible to use the myri_snf.ko
kernel module, which is a part of
the SNF software , which can be installed separately. To support a Myricom
network adapter, the module requires it to have a valid SNF licence, then it
makes supported adapters available as both regular network interfaces and
capture-optimized SNF devices. To support the SNF devices, libpcap needs to
be compiled in a specific way.
Two versions of the SNF software exist: SNFv3 and SNFv5. Depending on the hardware model, a Myricom adapter may be compatible with either SNFv3 or SNFv5. This version of libpcap has been tested on Linux/AMD64 using SNFv3 version 3.0.26.50935 and a Myricom 10G-PCIE2-8C2-2S adapter. Other operating systems have not been tested.
- Download the SNF software and its documentation, unpack the software to a directory.
- Build the
myri_snf.ko
kernel module in the unpacked SNF software directory, load it and verify that the module accepts the hardware as SNF device(s):cd /path/to/snf ./sbin/rebuild.sh rmmod myri10ge insmod ./sbin/myri_snf.ko ./bin/myri_nic_info
- Configure and build libpcap. For example, using Autoconf:
Here
cd /path/to/libpcap ./configure [--with-snf=DIR] [--with-pcap=snf]
DIR
is the directory with the unpacked SNF software if the directory is not the default/opt/snf/
, and--with-pcap=snf
would request an SNF-only build of libpcap if required. Ifconfigure
has detected the SNF software correctly, it will report:Then runconfigure: using Myricom SNF API headers from /path/to/snf/include configure: using Myricom SNF API libraries from /path/to/snf/lib
make testprogs
. - Verify that the compiled libpcap detects the SNF device(s)s using the SNF
API:
In the output of
LD_LIBRARY_PATH=/path/to/snf/lib ./testprogs/findalldevstest
findalldevstest
SNF devices should have "Myricom snf" in the description.
The only supported link-level header type is DLT_EN10MB
.
pcap_findalldevs(3PCAP) is supported. The connection status flags of each device reflect what the SNF API reports for the device, not what the regular network interface reports.
pcap_setfilter(3PCAP) is supported, BPF programs run in userspace.
pcap_inject(3PCAP) is supported.
pcap_setnonblock(3PCAP) is supported.
pcap_get_selectable_fd(3PCAP) is not supported.
pcap_setdirection(3PCAP) is not supported.