User Manual

Rev 2.2-1.0.1
Mellanox Technologies
109
Input parameters:
struct ibv_qp - the attached QP.
struct ibv_exp_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_
exp_
flow_attr can be followed by the optional flow headers structs:
struct ibv_
exp_
flow_spec_ib
struct ibv_
exp_
flow_spec_eth
struct ibv_
exp_
flow_spec_ipv4
struct ibv_
exp_
flow_spec_tcp_udp
For further information, please refer to the ibv_exp_create_flow man page.
Be advised that as of MLNX_OFED v2.0-3.0.0, the parameters (both the value and the
mask) should be set in big-endian format.
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_exp_destroy_flow
int ibv_
exp_
destroy_flow(struct ibv_
exp_
flow *flow_id)
Input parameters:
ibv_exp_destroy_flow requires struct ibv_exp_flow which is the return value of
ibv_exp_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_exp_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
All packets that contain the above destination MAC address are to be steered into rx-ring 2 (its
underlying QP), with priority 5 (within the ethtool domain)
ethtool –U eth5 flow-type tcp4 src-ip 1.2.3.4 dst-port 8888 loc 5 action 2