go.ligato.io/vpp-agent/v3@v3.5.0/plugins/vpp/binapi/vpp2106/rdma/rdma.ba.go (about) 1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT. 2 3 // Package rdma contains generated bindings for API file rdma.api. 4 // 5 // Contents: 6 // - 3 enums 7 // - 8 messages 8 package rdma 9 10 import ( 11 "strconv" 12 13 api "go.fd.io/govpp/api" 14 codec "go.fd.io/govpp/codec" 15 interface_types "go.ligato.io/vpp-agent/v3/plugins/vpp/binapi/vpp2106/interface_types" 16 ) 17 18 // This is a compile-time assertion to ensure that this generated file 19 // is compatible with the GoVPP api package it is being compiled against. 20 // A compilation error at this line likely means your copy of the 21 // GoVPP api package needs to be updated. 22 const _ = api.GoVppAPIPackageIsVersion2 23 24 const ( 25 APIFile = "rdma" 26 APIVersion = "3.0.0" 27 VersionCrc = 0xdab70fa9 28 ) 29 30 // RdmaMode defines enum 'rdma_mode'. 31 type RdmaMode uint32 32 33 const ( 34 RDMA_API_MODE_AUTO RdmaMode = 0 35 RDMA_API_MODE_IBV RdmaMode = 1 36 RDMA_API_MODE_DV RdmaMode = 2 37 ) 38 39 var ( 40 RdmaMode_name = map[uint32]string{ 41 0: "RDMA_API_MODE_AUTO", 42 1: "RDMA_API_MODE_IBV", 43 2: "RDMA_API_MODE_DV", 44 } 45 RdmaMode_value = map[string]uint32{ 46 "RDMA_API_MODE_AUTO": 0, 47 "RDMA_API_MODE_IBV": 1, 48 "RDMA_API_MODE_DV": 2, 49 } 50 ) 51 52 func (x RdmaMode) String() string { 53 s, ok := RdmaMode_name[uint32(x)] 54 if ok { 55 return s 56 } 57 return "RdmaMode(" + strconv.Itoa(int(x)) + ")" 58 } 59 60 // RdmaRss4 defines enum 'rdma_rss4'. 61 type RdmaRss4 uint32 62 63 const ( 64 RDMA_API_RSS4_AUTO RdmaRss4 = 0 65 RDMA_API_RSS4_IP RdmaRss4 = 1 66 RDMA_API_RSS4_IP_UDP RdmaRss4 = 2 67 RDMA_API_RSS4_IP_TCP RdmaRss4 = 3 68 ) 69 70 var ( 71 RdmaRss4_name = map[uint32]string{ 72 0: "RDMA_API_RSS4_AUTO", 73 1: "RDMA_API_RSS4_IP", 74 2: "RDMA_API_RSS4_IP_UDP", 75 3: "RDMA_API_RSS4_IP_TCP", 76 } 77 RdmaRss4_value = map[string]uint32{ 78 "RDMA_API_RSS4_AUTO": 0, 79 "RDMA_API_RSS4_IP": 1, 80 "RDMA_API_RSS4_IP_UDP": 2, 81 "RDMA_API_RSS4_IP_TCP": 3, 82 } 83 ) 84 85 func (x RdmaRss4) String() string { 86 s, ok := RdmaRss4_name[uint32(x)] 87 if ok { 88 return s 89 } 90 return "RdmaRss4(" + strconv.Itoa(int(x)) + ")" 91 } 92 93 // RdmaRss6 defines enum 'rdma_rss6'. 94 type RdmaRss6 uint32 95 96 const ( 97 RDMA_API_RSS6_AUTO RdmaRss6 = 0 98 RDMA_API_RSS6_IP RdmaRss6 = 1 99 RDMA_API_RSS6_IP_UDP RdmaRss6 = 2 100 RDMA_API_RSS6_IP_TCP RdmaRss6 = 3 101 ) 102 103 var ( 104 RdmaRss6_name = map[uint32]string{ 105 0: "RDMA_API_RSS6_AUTO", 106 1: "RDMA_API_RSS6_IP", 107 2: "RDMA_API_RSS6_IP_UDP", 108 3: "RDMA_API_RSS6_IP_TCP", 109 } 110 RdmaRss6_value = map[string]uint32{ 111 "RDMA_API_RSS6_AUTO": 0, 112 "RDMA_API_RSS6_IP": 1, 113 "RDMA_API_RSS6_IP_UDP": 2, 114 "RDMA_API_RSS6_IP_TCP": 3, 115 } 116 ) 117 118 func (x RdmaRss6) String() string { 119 s, ok := RdmaRss6_name[uint32(x)] 120 if ok { 121 return s 122 } 123 return "RdmaRss6(" + strconv.Itoa(int(x)) + ")" 124 } 125 126 // RdmaCreate defines message 'rdma_create'. 127 // Deprecated: 21.01 128 type RdmaCreate struct { 129 HostIf string `binapi:"string[64],name=host_if" json:"host_if,omitempty"` 130 Name string `binapi:"string[64],name=name" json:"name,omitempty"` 131 RxqNum uint16 `binapi:"u16,name=rxq_num,default=1" json:"rxq_num,omitempty"` 132 RxqSize uint16 `binapi:"u16,name=rxq_size,default=1024" json:"rxq_size,omitempty"` 133 TxqSize uint16 `binapi:"u16,name=txq_size,default=1024" json:"txq_size,omitempty"` 134 Mode RdmaMode `binapi:"rdma_mode,name=mode,default=0" json:"mode,omitempty"` 135 } 136 137 func (m *RdmaCreate) Reset() { *m = RdmaCreate{} } 138 func (*RdmaCreate) GetMessageName() string { return "rdma_create" } 139 func (*RdmaCreate) GetCrcString() string { return "076fe418" } 140 func (*RdmaCreate) GetMessageType() api.MessageType { 141 return api.RequestMessage 142 } 143 144 func (m *RdmaCreate) Size() (size int) { 145 if m == nil { 146 return 0 147 } 148 size += 64 // m.HostIf 149 size += 64 // m.Name 150 size += 2 // m.RxqNum 151 size += 2 // m.RxqSize 152 size += 2 // m.TxqSize 153 size += 4 // m.Mode 154 return size 155 } 156 func (m *RdmaCreate) Marshal(b []byte) ([]byte, error) { 157 if b == nil { 158 b = make([]byte, m.Size()) 159 } 160 buf := codec.NewBuffer(b) 161 buf.EncodeString(m.HostIf, 64) 162 buf.EncodeString(m.Name, 64) 163 buf.EncodeUint16(m.RxqNum) 164 buf.EncodeUint16(m.RxqSize) 165 buf.EncodeUint16(m.TxqSize) 166 buf.EncodeUint32(uint32(m.Mode)) 167 return buf.Bytes(), nil 168 } 169 func (m *RdmaCreate) Unmarshal(b []byte) error { 170 buf := codec.NewBuffer(b) 171 m.HostIf = buf.DecodeString(64) 172 m.Name = buf.DecodeString(64) 173 m.RxqNum = buf.DecodeUint16() 174 m.RxqSize = buf.DecodeUint16() 175 m.TxqSize = buf.DecodeUint16() 176 m.Mode = RdmaMode(buf.DecodeUint32()) 177 return nil 178 } 179 180 // RdmaCreateReply defines message 'rdma_create_reply'. 181 type RdmaCreateReply struct { 182 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 183 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 184 } 185 186 func (m *RdmaCreateReply) Reset() { *m = RdmaCreateReply{} } 187 func (*RdmaCreateReply) GetMessageName() string { return "rdma_create_reply" } 188 func (*RdmaCreateReply) GetCrcString() string { return "5383d31f" } 189 func (*RdmaCreateReply) GetMessageType() api.MessageType { 190 return api.ReplyMessage 191 } 192 193 func (m *RdmaCreateReply) Size() (size int) { 194 if m == nil { 195 return 0 196 } 197 size += 4 // m.Retval 198 size += 4 // m.SwIfIndex 199 return size 200 } 201 func (m *RdmaCreateReply) Marshal(b []byte) ([]byte, error) { 202 if b == nil { 203 b = make([]byte, m.Size()) 204 } 205 buf := codec.NewBuffer(b) 206 buf.EncodeInt32(m.Retval) 207 buf.EncodeUint32(uint32(m.SwIfIndex)) 208 return buf.Bytes(), nil 209 } 210 func (m *RdmaCreateReply) Unmarshal(b []byte) error { 211 buf := codec.NewBuffer(b) 212 m.Retval = buf.DecodeInt32() 213 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 214 return nil 215 } 216 217 // RdmaCreateV2 defines message 'rdma_create_v2'. 218 // Deprecated: the message will be removed in the future versions 219 type RdmaCreateV2 struct { 220 HostIf string `binapi:"string[64],name=host_if" json:"host_if,omitempty"` 221 Name string `binapi:"string[64],name=name" json:"name,omitempty"` 222 RxqNum uint16 `binapi:"u16,name=rxq_num,default=1" json:"rxq_num,omitempty"` 223 RxqSize uint16 `binapi:"u16,name=rxq_size,default=1024" json:"rxq_size,omitempty"` 224 TxqSize uint16 `binapi:"u16,name=txq_size,default=1024" json:"txq_size,omitempty"` 225 Mode RdmaMode `binapi:"rdma_mode,name=mode,default=0" json:"mode,omitempty"` 226 NoMultiSeg bool `binapi:"bool,name=no_multi_seg,default=0" json:"no_multi_seg,omitempty"` 227 MaxPktlen uint16 `binapi:"u16,name=max_pktlen,default=0" json:"max_pktlen,omitempty"` 228 } 229 230 func (m *RdmaCreateV2) Reset() { *m = RdmaCreateV2{} } 231 func (*RdmaCreateV2) GetMessageName() string { return "rdma_create_v2" } 232 func (*RdmaCreateV2) GetCrcString() string { return "5826a4f3" } 233 func (*RdmaCreateV2) GetMessageType() api.MessageType { 234 return api.RequestMessage 235 } 236 237 func (m *RdmaCreateV2) Size() (size int) { 238 if m == nil { 239 return 0 240 } 241 size += 64 // m.HostIf 242 size += 64 // m.Name 243 size += 2 // m.RxqNum 244 size += 2 // m.RxqSize 245 size += 2 // m.TxqSize 246 size += 4 // m.Mode 247 size += 1 // m.NoMultiSeg 248 size += 2 // m.MaxPktlen 249 return size 250 } 251 func (m *RdmaCreateV2) Marshal(b []byte) ([]byte, error) { 252 if b == nil { 253 b = make([]byte, m.Size()) 254 } 255 buf := codec.NewBuffer(b) 256 buf.EncodeString(m.HostIf, 64) 257 buf.EncodeString(m.Name, 64) 258 buf.EncodeUint16(m.RxqNum) 259 buf.EncodeUint16(m.RxqSize) 260 buf.EncodeUint16(m.TxqSize) 261 buf.EncodeUint32(uint32(m.Mode)) 262 buf.EncodeBool(m.NoMultiSeg) 263 buf.EncodeUint16(m.MaxPktlen) 264 return buf.Bytes(), nil 265 } 266 func (m *RdmaCreateV2) Unmarshal(b []byte) error { 267 buf := codec.NewBuffer(b) 268 m.HostIf = buf.DecodeString(64) 269 m.Name = buf.DecodeString(64) 270 m.RxqNum = buf.DecodeUint16() 271 m.RxqSize = buf.DecodeUint16() 272 m.TxqSize = buf.DecodeUint16() 273 m.Mode = RdmaMode(buf.DecodeUint32()) 274 m.NoMultiSeg = buf.DecodeBool() 275 m.MaxPktlen = buf.DecodeUint16() 276 return nil 277 } 278 279 // RdmaCreateV2Reply defines message 'rdma_create_v2_reply'. 280 type RdmaCreateV2Reply struct { 281 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 282 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 283 } 284 285 func (m *RdmaCreateV2Reply) Reset() { *m = RdmaCreateV2Reply{} } 286 func (*RdmaCreateV2Reply) GetMessageName() string { return "rdma_create_v2_reply" } 287 func (*RdmaCreateV2Reply) GetCrcString() string { return "5383d31f" } 288 func (*RdmaCreateV2Reply) GetMessageType() api.MessageType { 289 return api.ReplyMessage 290 } 291 292 func (m *RdmaCreateV2Reply) Size() (size int) { 293 if m == nil { 294 return 0 295 } 296 size += 4 // m.Retval 297 size += 4 // m.SwIfIndex 298 return size 299 } 300 func (m *RdmaCreateV2Reply) Marshal(b []byte) ([]byte, error) { 301 if b == nil { 302 b = make([]byte, m.Size()) 303 } 304 buf := codec.NewBuffer(b) 305 buf.EncodeInt32(m.Retval) 306 buf.EncodeUint32(uint32(m.SwIfIndex)) 307 return buf.Bytes(), nil 308 } 309 func (m *RdmaCreateV2Reply) Unmarshal(b []byte) error { 310 buf := codec.NewBuffer(b) 311 m.Retval = buf.DecodeInt32() 312 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 313 return nil 314 } 315 316 // RdmaCreateV3 defines message 'rdma_create_v3'. 317 type RdmaCreateV3 struct { 318 HostIf string `binapi:"string[64],name=host_if" json:"host_if,omitempty"` 319 Name string `binapi:"string[64],name=name" json:"name,omitempty"` 320 RxqNum uint16 `binapi:"u16,name=rxq_num,default=1" json:"rxq_num,omitempty"` 321 RxqSize uint16 `binapi:"u16,name=rxq_size,default=1024" json:"rxq_size,omitempty"` 322 TxqSize uint16 `binapi:"u16,name=txq_size,default=1024" json:"txq_size,omitempty"` 323 Mode RdmaMode `binapi:"rdma_mode,name=mode,default=0" json:"mode,omitempty"` 324 NoMultiSeg bool `binapi:"bool,name=no_multi_seg,default=0" json:"no_multi_seg,omitempty"` 325 MaxPktlen uint16 `binapi:"u16,name=max_pktlen,default=0" json:"max_pktlen,omitempty"` 326 Rss4 RdmaRss4 `binapi:"rdma_rss4,name=rss4,default=0" json:"rss4,omitempty"` 327 Rss6 RdmaRss6 `binapi:"rdma_rss6,name=rss6,default=0" json:"rss6,omitempty"` 328 } 329 330 func (m *RdmaCreateV3) Reset() { *m = RdmaCreateV3{} } 331 func (*RdmaCreateV3) GetMessageName() string { return "rdma_create_v3" } 332 func (*RdmaCreateV3) GetCrcString() string { return "c6287ea8" } 333 func (*RdmaCreateV3) GetMessageType() api.MessageType { 334 return api.RequestMessage 335 } 336 337 func (m *RdmaCreateV3) Size() (size int) { 338 if m == nil { 339 return 0 340 } 341 size += 64 // m.HostIf 342 size += 64 // m.Name 343 size += 2 // m.RxqNum 344 size += 2 // m.RxqSize 345 size += 2 // m.TxqSize 346 size += 4 // m.Mode 347 size += 1 // m.NoMultiSeg 348 size += 2 // m.MaxPktlen 349 size += 4 // m.Rss4 350 size += 4 // m.Rss6 351 return size 352 } 353 func (m *RdmaCreateV3) Marshal(b []byte) ([]byte, error) { 354 if b == nil { 355 b = make([]byte, m.Size()) 356 } 357 buf := codec.NewBuffer(b) 358 buf.EncodeString(m.HostIf, 64) 359 buf.EncodeString(m.Name, 64) 360 buf.EncodeUint16(m.RxqNum) 361 buf.EncodeUint16(m.RxqSize) 362 buf.EncodeUint16(m.TxqSize) 363 buf.EncodeUint32(uint32(m.Mode)) 364 buf.EncodeBool(m.NoMultiSeg) 365 buf.EncodeUint16(m.MaxPktlen) 366 buf.EncodeUint32(uint32(m.Rss4)) 367 buf.EncodeUint32(uint32(m.Rss6)) 368 return buf.Bytes(), nil 369 } 370 func (m *RdmaCreateV3) Unmarshal(b []byte) error { 371 buf := codec.NewBuffer(b) 372 m.HostIf = buf.DecodeString(64) 373 m.Name = buf.DecodeString(64) 374 m.RxqNum = buf.DecodeUint16() 375 m.RxqSize = buf.DecodeUint16() 376 m.TxqSize = buf.DecodeUint16() 377 m.Mode = RdmaMode(buf.DecodeUint32()) 378 m.NoMultiSeg = buf.DecodeBool() 379 m.MaxPktlen = buf.DecodeUint16() 380 m.Rss4 = RdmaRss4(buf.DecodeUint32()) 381 m.Rss6 = RdmaRss6(buf.DecodeUint32()) 382 return nil 383 } 384 385 // RdmaCreateV3Reply defines message 'rdma_create_v3_reply'. 386 type RdmaCreateV3Reply struct { 387 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 388 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 389 } 390 391 func (m *RdmaCreateV3Reply) Reset() { *m = RdmaCreateV3Reply{} } 392 func (*RdmaCreateV3Reply) GetMessageName() string { return "rdma_create_v3_reply" } 393 func (*RdmaCreateV3Reply) GetCrcString() string { return "5383d31f" } 394 func (*RdmaCreateV3Reply) GetMessageType() api.MessageType { 395 return api.ReplyMessage 396 } 397 398 func (m *RdmaCreateV3Reply) Size() (size int) { 399 if m == nil { 400 return 0 401 } 402 size += 4 // m.Retval 403 size += 4 // m.SwIfIndex 404 return size 405 } 406 func (m *RdmaCreateV3Reply) Marshal(b []byte) ([]byte, error) { 407 if b == nil { 408 b = make([]byte, m.Size()) 409 } 410 buf := codec.NewBuffer(b) 411 buf.EncodeInt32(m.Retval) 412 buf.EncodeUint32(uint32(m.SwIfIndex)) 413 return buf.Bytes(), nil 414 } 415 func (m *RdmaCreateV3Reply) Unmarshal(b []byte) error { 416 buf := codec.NewBuffer(b) 417 m.Retval = buf.DecodeInt32() 418 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 419 return nil 420 } 421 422 // RdmaDelete defines message 'rdma_delete'. 423 type RdmaDelete struct { 424 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 425 } 426 427 func (m *RdmaDelete) Reset() { *m = RdmaDelete{} } 428 func (*RdmaDelete) GetMessageName() string { return "rdma_delete" } 429 func (*RdmaDelete) GetCrcString() string { return "f9e6675e" } 430 func (*RdmaDelete) GetMessageType() api.MessageType { 431 return api.RequestMessage 432 } 433 434 func (m *RdmaDelete) Size() (size int) { 435 if m == nil { 436 return 0 437 } 438 size += 4 // m.SwIfIndex 439 return size 440 } 441 func (m *RdmaDelete) Marshal(b []byte) ([]byte, error) { 442 if b == nil { 443 b = make([]byte, m.Size()) 444 } 445 buf := codec.NewBuffer(b) 446 buf.EncodeUint32(uint32(m.SwIfIndex)) 447 return buf.Bytes(), nil 448 } 449 func (m *RdmaDelete) Unmarshal(b []byte) error { 450 buf := codec.NewBuffer(b) 451 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 452 return nil 453 } 454 455 // RdmaDeleteReply defines message 'rdma_delete_reply'. 456 type RdmaDeleteReply struct { 457 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 458 } 459 460 func (m *RdmaDeleteReply) Reset() { *m = RdmaDeleteReply{} } 461 func (*RdmaDeleteReply) GetMessageName() string { return "rdma_delete_reply" } 462 func (*RdmaDeleteReply) GetCrcString() string { return "e8d4e804" } 463 func (*RdmaDeleteReply) GetMessageType() api.MessageType { 464 return api.ReplyMessage 465 } 466 467 func (m *RdmaDeleteReply) Size() (size int) { 468 if m == nil { 469 return 0 470 } 471 size += 4 // m.Retval 472 return size 473 } 474 func (m *RdmaDeleteReply) Marshal(b []byte) ([]byte, error) { 475 if b == nil { 476 b = make([]byte, m.Size()) 477 } 478 buf := codec.NewBuffer(b) 479 buf.EncodeInt32(m.Retval) 480 return buf.Bytes(), nil 481 } 482 func (m *RdmaDeleteReply) Unmarshal(b []byte) error { 483 buf := codec.NewBuffer(b) 484 m.Retval = buf.DecodeInt32() 485 return nil 486 } 487 488 func init() { file_rdma_binapi_init() } 489 func file_rdma_binapi_init() { 490 api.RegisterMessage((*RdmaCreate)(nil), "rdma_create_076fe418") 491 api.RegisterMessage((*RdmaCreateReply)(nil), "rdma_create_reply_5383d31f") 492 api.RegisterMessage((*RdmaCreateV2)(nil), "rdma_create_v2_5826a4f3") 493 api.RegisterMessage((*RdmaCreateV2Reply)(nil), "rdma_create_v2_reply_5383d31f") 494 api.RegisterMessage((*RdmaCreateV3)(nil), "rdma_create_v3_c6287ea8") 495 api.RegisterMessage((*RdmaCreateV3Reply)(nil), "rdma_create_v3_reply_5383d31f") 496 api.RegisterMessage((*RdmaDelete)(nil), "rdma_delete_f9e6675e") 497 api.RegisterMessage((*RdmaDeleteReply)(nil), "rdma_delete_reply_e8d4e804") 498 } 499 500 // Messages returns list of all messages in this module. 501 func AllMessages() []api.Message { 502 return []api.Message{ 503 (*RdmaCreate)(nil), 504 (*RdmaCreateReply)(nil), 505 (*RdmaCreateV2)(nil), 506 (*RdmaCreateV2Reply)(nil), 507 (*RdmaCreateV3)(nil), 508 (*RdmaCreateV3Reply)(nil), 509 (*RdmaDelete)(nil), 510 (*RdmaDeleteReply)(nil), 511 } 512 }