memif: multi-queues support
[vpp.git] / src / plugins / memif / memif.api
1 /*
2  * Copyright (c) 2017 Cisco and/or its affiliates.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at:
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15
16 /** \brief Create memory interface
17     @param client_index - opaque cookie to identify the sender
18     @param context - sender context, to match reply w/ request
19     @param role - role of the interface in the connection (master/slave)
20     @param rx_queues - number of rx queues (only valid for slave)
21     #param tx_queues - number of tx queues (only valid for slave)
22     @param key - 64bit integer used to authenticate and match opposite sides
23            of the connection
24     @param socket_filename - filename of the socket to be used for connection
25            establishment
26     @param ring_size - the number of entries of RX/TX rings
27     @param buffer_size - size of the buffer allocated for each ring entry
28     @param hw_addr - interface MAC address
29 */
30 define memif_create
31 {
32   u32 client_index;
33   u32 context;
34
35   u8 role; /* 0 = master, 1 = slave */
36   u8 rx_queues; /* optional, default is 1 */
37   u8 tx_queues; /* optional, default is 1 */
38   u64 key; /* optional, default is 0 */
39   u8 socket_filename[128]; /* optional, default is "/var/vpp/memif.sock"
40                               and can be changed in VPP startup config */
41
42   u32 ring_size; /* optional, default is 1024 entries, must be power of 2 */
43   u16 buffer_size; /* optional, default is 2048 bytes */
44   u8 hw_addr[6]; /* optional, randomly generated if not defined */
45 };
46
47 /** \brief Create memory interface response
48     @param context - sender context, to match reply w/ request
49     @param retval - return value for request
50     @param sw_if_index - software index of the newly created interface
51 */
52 define memif_create_reply
53 {
54   u32 context;
55   i32 retval;
56   u32 sw_if_index;
57 };
58
59 /** \brief Delete memory interface
60     @param client_index - opaque cookie to identify the sender
61     @param context - sender context, to match reply w/ request
62     @param sw_if_index - software index of the interface to delete
63 */
64 autoreply define memif_delete
65 {
66   u32 client_index;
67   u32 context;
68
69   u32 sw_if_index;
70 };
71
72 /** \brief Memory interface details structure
73     @param context - sender context, to match reply w/ request (memif_dump)
74     @param sw_if_index - index of the interface
75     @param if_name - name of the interface
76     @param hw_addr - interface MAC address
77     @param key - key associated with the interface
78     @param role - role of the interface in the connection (master/slave)
79     @param socket_filename - name of the socket used by this interface
80            to establish new connections
81     @param ring_size - the number of entries of RX/TX rings
82     @param buffer_size - size of the buffer allocated for each ring entry
83     @param admin_up_down - interface administrative status
84     @param link_up_down - interface link status
85
86 */
87 define memif_details
88 {
89   u32 context;
90
91   u32 sw_if_index;
92   u8 if_name[64];
93   u8 hw_addr[6];
94
95   /* memif specific parameters */
96   u64 key;
97   u8 role; /* 0 = master, 1 = slave */
98   u8 socket_filename[128];
99   u32 ring_size;
100   u16 buffer_size; /* optional, default is 2048 bytes */
101
102   /* 1 = up, 0 = down */
103   u8 admin_up_down;
104   u8 link_up_down;
105 };
106
107 /** \brief Dump all memory interfaces
108     @param client_index - opaque cookie to identify the sender
109     @param context - sender context, to match reply w/ request
110 */
111 define memif_dump
112 {
113   u32 client_index;
114   u32 context;
115 };
116
117 /*
118  * Local Variables:
119  * eval: (c-set-style "gnu")
120  * End:
121  */