net/mlx5: rewrite TTL by E-Switch
authorXiaoyu Min <jackmin@mellanox.com>
Tue, 16 Oct 2018 08:14:30 +0000 (08:14 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 18 Oct 2018 08:24:39 +0000 (10:24 +0200)
commita7cb5bcd281e286bb77f54acb61f59046a66c465
tree399e669ffbc9f367ffb12de9a383006612a05414
parent708d0bcb72c2f70432e782de754984c8f4255301
net/mlx5: rewrite TTL by E-Switch

Offload following modify TTL actions to E-Switch via
TC-Flower driver

- RTE_FLOW_ACTION_TYPE_SET_TTL
- RTE_FLOW_ACTION_TYPE_DEC_TTL

The corresponding IP protocol rte_flow_item_ipv[4|6]
must be present in rte_flow pattern otherwith PMD
return error

The example testpmd commands are:

    flow create 0 transfer ingress
         pattern eth / ipv4 / udp dst is 7000 / end
 actions dec_ttl /
 port_id id 1 / end

    flow create 0 transfer ingress
         pattern eth / ipv4 / udp dst is 7001 / end
 actions set_ttl ttl_value 10 /
 port_id id 1 / end

Signed-off-by: Xiaoyu Min <jackmin@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
drivers/net/mlx5/mlx5_flow.h
drivers/net/mlx5/mlx5_flow_tcf.c