Professional Documents
Culture Documents
1. Accolade Support
1.1. Prerequisite
PF_RING has na�ve support for Accolade adapters, the Accolade SDK (v.1.2.26 or later) needs to
be installed (under /opt/accolade) in order to enable the Accolade module at run�me.
1.2. Installation
In order to install the Accolade SDK and drivers run the following commands:
If you are running an old firmware and you need to update it, you should run the following
commands:
cd SDK_*/tools/; make
gunzip fpga_*.rbt.gz
sudo ./anic_fwupdate --id 0 --script fpga_*.rbt
sudo reboot
Now you are ready to compile and run PF_RING with Accolade support. Note that if you are
installing pfring from packages, Accolade support is already enabled.
cd PF_RING/kernel; make
sudo insmod pf_ring.ko; cd ..
cd userland; ./configure
cd lib; make; cd ..
cd libpcap; ./configure; make; cd ..
cd examples; make
sudo ./pfcount -i anic:0
1 di 4 13/07/18, 09:14
Please note that:
in Support
1. Accolade order to open port 0 from
— PF_RING adapter 0 you should specify
7.0 documentation anic:DEV:PORT, example:
http://www.ntop.org/guides/pf_ring/modules/acc...
pfcount -i anic:0:0
pfcount -i anic:0
Opening a port this way, the full card is ini�alised, causing issues when opening other ports later
(previous ports stop working), this can be avoided using the port-to-ring binding as explained later
on. - in order to open ring 0 from adapter 0 you should specify anic:DEV@RING, example:
pfcount -i anic:0@0
This is usually used in combina�on with anic_rx_block_mfl which is used to setup the card for
mul�-process applica�ons.
anic_rx_block_mfl -i 0 --mode=2
anic_rx_block_mfl -i 0 --mode=port
1.4. Hw Filtering
Accolade adapters support packet filtering in hw. In order to set an hw filter there are two op�ons:
Using the standard BPF filter: PF_RING thanks to the nBPF library automa�cally translates BPF
filters into hw filters
Using the pfring_add_hw_rule() API.
2 di 4 13/07/18, 09:14
When using the pfring_add_hw_rule() API, as first ac�on we need to set the default behaviour for
packets,
1. Accolade this can
Support — be ‘pass’ or7.0
PF_RING ‘drop’. Example:
documentation http://www.ntop.org/guides/pf_ring/modules/acc...
hw_filtering_rule r;
r.rule_family_type = accolade_default;
r.rule_family.accolade_rule.action = accolade_pass;
pfring_add_hw_rule(pd, &r);
In order to set a filtering rule, we need to create a rule and assign a rule ID, which is a unique
iden�fier for the rule. A standard Accolade firmware supports up to 32 rules (called ‘legacy mode’
or ‘mode 1’), with IDs from 0 to 31. Enhanced Accolade firmwares for 100 Gbit adapters can
support up to 1000 rules, with IDs from 0 to 999 (called ‘mode 2’). PF_RING automa�cally select
‘mode 2’ when available, and ‘mode 1’ as fallback. It is possible to use the
FILTERING_RULE_AUTO_RULE_ID macro as rule.rule_id in order to automa�cally assign the next
available rule ID. Example of se�ng a filtering rule with ‘drop’ ac�on for an IPv4 packet:
hw_filtering_rule r = { 0 };
r.rule_id = rule_id++;
r.rule_family_type = accolade_rule;
r.rule_family.accolade_rule.action = accolade_drop;
r.rule_family.accolade_rule.ip_version = h->extended_hdr.parsed_pkt.ip_version;
r.rule_family.accolade_rule.src_addr_bits = 32;
r.rule_family.accolade_rule.src_addr.v4 = h->extended_hdr.parsed_pkt.ipv4_src;
r.rule_family.accolade_rule.dst_addr_bits = 32;
r.rule_family.accolade_rule.dst_addr.v4 = h->extended_hdr.parsed_pkt.ipv4_dst;
r.rule_family.accolade_rule.protocol = h->extended_hdr.parsed_pkt.l3_proto;
r.rule_family.accolade_rule.src_port_low = h->extended_hdr.parsed_pkt.l4_src_port;
r.rule_family.accolade_rule.dst_port_low = h->extended_hdr.parsed_pkt.l4_dst_port;
pfring_add_hw_rule(pd, &r);
For a full list of supported fields please take a look at the hw_filtering_rule struct. Please also note
that mode 1 and 2 support different fields, please refer to the fields descrip�on to check what is
supported in each mode.
pfring_remove_hw_rule(pd, rule_id);
1.5. TX DMA
If you have an Accolade adapter (e.g. 200Ku-Flex) with a firmware suppor�ng TX DMA for
replaying PCAP files at line-rate up to 100G, you need to enable both 2MB and 1G hugepages.
First of all you should check that your CPU supports 1G hugepages, running the command below
you should get some output:
In order to apply the changes, update grub and reboot the system:
sudo update-grub
sudo reboot
A�er reboo�ng the system, you should mount the hugepages and reload the Accolade driver:
At this point you should be finally able to run the TX tool provided by Accolade, example:
cd SDK_*/examples/; make
sudo ./anic_200k_tx -i 0 -p 0 -r 1000000 mixed.pcap
4 di 4 13/07/18, 09:14