User Manual
Rev 2.1-1.0.6
Mellanox Technologies
89
• ibv_create_flow
struct ibv_flow *ibv_create_flow(struct ibv_qp *qp, struct ibv_flow_attr *flow)
Input parameters:
• struct ibv_qp - the attached QP.
•
struct ibv_flow_attr - attaches the QP to the flow specified. The flow contains mandatory control
parameters and optional L2, L3 and L4 headers. The optional headers are detected by setting the size and
num_of_specs fields:
struct ibv_flow_attr can be followed by the optional flow headers structs:
For further information, please refer to the ibv_create_flow man page.
Each header struct holds the relevant network layer parameters for matching. To enforce the match, the
user sets a mask for each parameter. The supported masks are:
• All one mask - include the parameter value in the attached rule
Note: Since the VLAN ID in the Ethernet header is 12bit long, the following parameter should be
used: flow_spec_eth.mask.vlan_tag = htons(0x0fff).
• All zero mask - ignore the parameter value in the attached rule
When setting the flow type to NORMAL, the incoming traffic will be steered according to the rule spec-
ifications. ALL_DEFAULT and MC_DEFAULT rules options are valid only for Ethernet link type since
InfiniBand link type packets always include QP number.
For further information, please refer to the relevant man pages.
• ibv_destroy_flow
int ibv_destroy_flow(struct ibv_flow *flow_id)
Input parameters:
ibv_destroy_flow requires struct ibv_flow which is the return value of ibv_create_flow in
case of success.
Output parameters:
Returns 0 on success, or the value of errno on failure.
For further information, please refer to the
ibv_destroy_flow man page.
• Ethtool
Ethtool domain is used to attach an RX ring, specifically its QP to a specified flow.
Please refer to the most recent ethtool manpage for all the ways to specify a flow.
Examples:
• ethtool –U eth5 flow-type ether dst 00:11:22:33:44:55 loc 5 action 2
struct ibv_flow_spec_ib
struct ibv_flow_spec_eth
struct ibv_flow_spec_ipv4
struct ibv_flow_spec_tcp_udp
Be advised that from MLNX_OFED v2.0-3.0.0 and higher, the parameters (both the
value and the mask) should be set in big-endian format.