History

IB/uverbs: Add flow_action create and destroy verbs

A verbs application may receive and transmits packets using a data path pipeline. Sometimes, the first stage in the receive pipeline or the last stage in the transmit pipeline involves transforming a packet, either in order to make it easier for later stages to process it or to prepare it for transmission over the wire. Such transformation could be stripping/encapsulating the packet (i.e. vxlan), decrypting/encrypting it (i.e. ipsec), altering headers, doing some complex FPGA changes, etc. Some hardware could do such transformations without software data path intervention at all. The flow steering API supports steering a packet (either to a QP or dropping it) and some simple packet immutable actions (i.e. tagging a packet). Complex actions, that may change the packet, could bloat the flow steering API extensively. Sometimes the same action should be applied to several flows. In this case, it's easier to bind several flows to the same action and modify it than change all matching flows. Introducing a new flow_action object that abstracts any packet transformation (out of a standard and well defined set of actions). This flow_action object could be tied to a flow steering rule via a new specification. Currently, we support esp flow_action, which encrypts or decrypts a packet according to the given parameters. However, we present a flexible schema that could be used to other transformation actions tied to flow rules.

Matan Barak committed 8 years ago

Commit 2eb9bea1 parent 766d8557 files · +506 −2Browse files

Showing the changes to include/uapi (2 of 7 files). Show all

Unified · Split

2 files
  1. include/uapi/rdma/ib_user_ioctl_cmds.h +19 −0
  2. include/uapi/rdma/ib_user_ioctl_verbs.h +59 −0
include/uapi/rdma/ib_user_ioctl_cmds.h+19−0
@@ -53,6 +53,7 @@ enum uverbs_default_objects { · 52 unmodified lines
53 UVERBS_OBJECT_XRCD,53 UVERBS_OBJECT_XRCD,
54 UVERBS_OBJECT_RWQ_IND_TBL,54 UVERBS_OBJECT_RWQ_IND_TBL,
55 UVERBS_OBJECT_WQ,55 UVERBS_OBJECT_WQ,
56 UVERBS_OBJECT_FLOW_ACTION,
56};57};
57 58
58enum {59enum {
@@ -75,9 +76,27 @@ enum uverbs_attrs_destroy_cq_cmd_attr_ids { · 16 unmodified lines
75 UVERBS_ATTR_DESTROY_CQ_RESP,76 UVERBS_ATTR_DESTROY_CQ_RESP,
76};77};
77 78
79enum uverbs_attrs_create_flow_action_esp {
80 UVERBS_ATTR_FLOW_ACTION_ESP_HANDLE,
81 UVERBS_ATTR_FLOW_ACTION_ESP_ATTRS,
82 UVERBS_ATTR_FLOW_ACTION_ESP_ESN,
83 UVERBS_ATTR_FLOW_ACTION_ESP_KEYMAT,
84 UVERBS_ATTR_FLOW_ACTION_ESP_REPLAY,
85 UVERBS_ATTR_FLOW_ACTION_ESP_ENCAP,
86};
87
88enum uverbs_attrs_destroy_flow_action_esp {
89 UVERBS_ATTR_DESTROY_FLOW_ACTION_HANDLE,
90};
91
78enum uverbs_methods_cq {92enum uverbs_methods_cq {
79 UVERBS_METHOD_CQ_CREATE,93 UVERBS_METHOD_CQ_CREATE,
80 UVERBS_METHOD_CQ_DESTROY,94 UVERBS_METHOD_CQ_DESTROY,
81};95};
82 96
97enum uverbs_methods_actions_flow_action_ops {
98 UVERBS_METHOD_FLOW_ACTION_ESP_CREATE,
99 UVERBS_METHOD_FLOW_ACTION_DESTROY,
100};
101
83#endif102#endif
include/uapi/rdma/ib_user_ioctl_verbs.h+59−0
@@ -40,4 +40,63 @@ · 39 unmodified lines
40#define RDMA_UAPI_PTR(_type, _name) __aligned_u64 _name40#define RDMA_UAPI_PTR(_type, _name) __aligned_u64 _name
41#endif41#endif
42 42
43enum ib_uverbs_flow_action_esp_keymat {
44 IB_UVERBS_FLOW_ACTION_ESP_KEYMAT_AES_GCM,
45};
46
47enum ib_uverbs_flow_action_esp_keymat_aes_gcm_iv_algo {
48 IB_UVERBS_FLOW_ACTION_IV_ALGO_SEQ,
49};
50
51struct ib_uverbs_flow_action_esp_keymat_aes_gcm {
52 __aligned_u64 iv;
53 __u32 iv_algo; /* Use enum ib_uverbs_flow_action_esp_keymat_aes_gcm_iv_algo */
54
55 __u32 salt;
56 __u32 icv_len;
57
58 __u32 key_len;
59 __u32 aes_key[256 / 32];
60};
61
62enum ib_uverbs_flow_action_esp_replay {
63 IB_UVERBS_FLOW_ACTION_ESP_REPLAY_NONE,
64 IB_UVERBS_FLOW_ACTION_ESP_REPLAY_BMP,
65};
66
67struct ib_uverbs_flow_action_esp_replay_bmp {
68 __u32 size;
69};
70
71enum ib_uverbs_flow_action_esp_flags {
72 IB_UVERBS_FLOW_ACTION_ESP_FLAGS_INLINE_CRYPTO = 0UL << 0, /* Default */
73 IB_UVERBS_FLOW_ACTION_ESP_FLAGS_FULL_OFFLOAD = 1UL << 0,
74
75 IB_UVERBS_FLOW_ACTION_ESP_FLAGS_TUNNEL = 0UL << 1, /* Default */
76 IB_UVERBS_FLOW_ACTION_ESP_FLAGS_TRANSPORT = 1UL << 1,
77
78 IB_UVERBS_FLOW_ACTION_ESP_FLAGS_DECRYPT = 0UL << 2, /* Default */
79 IB_UVERBS_FLOW_ACTION_ESP_FLAGS_ENCRYPT = 1UL << 2,
80
81 IB_UVERBS_FLOW_ACTION_ESP_FLAGS_ESN_NEW_WINDOW = 1UL << 3,
82};
83
84struct ib_uverbs_flow_action_esp_encap {
85 /* This struct represents a list of pointers to flow_xxxx_filter that
86 * encapsulates the payload in ESP tunnel mode.
87 */
88 RDMA_UAPI_PTR(void *, val_ptr); /* pointer to a flow_xxxx_filter */
89 RDMA_UAPI_PTR(struct ib_uverbs_flow_action_esp_encap *, next_ptr);
90 __u16 len; /* Len of the filter struct val_ptr points to */
91 __u16 type; /* Use flow_spec_type enum */
92};
93
94struct ib_uverbs_flow_action_esp {
95 __u32 spi;
96 __u32 seq;
97 __u32 tfc_pad;
98 __u32 flags;
99 __aligned_u64 hard_limit_pkts;
100};
101
43#endif102#endif

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t