Files @ d0a14f973771
Branch filter:

Location: vmkdrivers/BLD/build/HEADERS/vmkapi-current-all-public/vmkernel64/release/net/vmkapi_net_pt.h

unknown
ESXi-5.0-U1
   1
   2
   3
   4
   5
   6
   7
   8
   9
  10
  11
  12
  13
  14
  15
  16
  17
  18
  19
  20
  21
  22
  23
  24
  25
  26
  27
  28
  29
  30
  31
  32
  33
  34
  35
  36
  37
  38
  39
  40
  41
  42
  43
  44
  45
  46
  47
  48
  49
  50
  51
  52
  53
  54
  55
  56
  57
  58
  59
  60
  61
  62
  63
  64
  65
  66
  67
  68
  69
  70
  71
  72
  73
  74
  75
  76
  77
  78
  79
  80
  81
  82
  83
  84
  85
  86
  87
  88
  89
  90
  91
  92
  93
  94
  95
  96
  97
  98
  99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 145
 146
 147
 148
 149
 150
 151
 152
 153
 154
 155
 156
 157
 158
 159
 160
 161
 162
 163
 164
 165
 166
 167
 168
 169
 170
 171
 172
 173
 174
 175
 176
 177
 178
 179
 180
 181
 182
 183
 184
 185
 186
 187
 188
 189
 190
 191
 192
 193
 194
 195
 196
 197
 198
 199
 200
 201
 202
 203
 204
 205
 206
 207
 208
 209
 210
 211
 212
 213
 214
 215
 216
 217
 218
 219
 220
 221
 222
 223
 224
 225
 226
 227
 228
 229
 230
 231
 232
 233
 234
 235
 236
 237
 238
 239
 240
 241
 242
 243
 244
 245
 246
 247
 248
 249
 250
 251
 252
 253
 254
 255
 256
 257
 258
 259
 260
 261
 262
 263
 264
 265
 266
 267
 268
 269
 270
 271
 272
 273
 274
 275
 276
 277
 278
 279
 280
 281
 282
 283
 284
 285
 286
 287
 288
 289
 290
 291
 292
 293
 294
 295
 296
 297
 298
 299
 300
 301
 302
 303
 304
 305
 306
 307
 308
 309
 310
 311
 312
 313
 314
 315
 316
 317
 318
 319
 320
 321
 322
 323
 324
 325
 326
 327
 328
 329
 330
 331
 332
 333
 334
 335
 336
 337
 338
 339
 340
 341
 342
 343
 344
 345
 346
 347
 348
 349
 350
 351
 352
 353
 354
 355
 356
 357
 358
 359
 360
 361
 362
 363
 364
 365
 366
 367
 368
 369
 370
 371
 372
 373
 374
 375
 376
 377
 378
 379
 380
 381
 382
 383
 384
 385
 386
 387
 388
 389
 390
 391
 392
 393
 394
 395
 396
 397
 398
 399
 400
 401
 402
 403
 404
 405
 406
 407
 408
 409
 410
 411
 412
 413
 414
 415
 416
 417
 418
 419
 420
 421
 422
 423
 424
 425
 426
 427
 428
 429
 430
 431
 432
 433
 434
 435
 436
 437
 438
 439
 440
 441
 442
 443
 444
 445
 446
 447
 448
 449
 450
 451
 452
 453
 454
 455
 456
 457
 458
 459
 460
 461
 462
 463
 464
 465
 466
 467
 468
 469
 470
 471
 472
 473
 474
 475
 476
 477
 478
 479
 480
 481
 482
 483
 484
 485
 486
 487
 488
 489
 490
 491
 492
 493
 494
 495
 496
 497
 498
 499
 500
 501
 502
 503
 504
 505
 506
 507
 508
 509
 510
 511
 512
 513
 514
 515
 516
 517
 518
 519
 520
 521
 522
 523
 524
 525
 526
 527
 528
 529
 530
 531
 532
 533
 534
 535
 536
 537
 538
 539
 540
 541
 542
 543
 544
 545
 546
 547
 548
 549
 550
 551
 552
 553
 554
 555
 556
 557
 558
 559
 560
 561
 562
 563
 564
 565
 566
 567
 568
 569
 570
 571
 572
 573
 574
 575
 576
 577
 578
 579
 580
 581
 582
 583
 584
 585
 586
 587
 588
 589
 590
 591
 592
 593
 594
 595
 596
 597
 598
 599
 600
 601
 602
 603
 604
 605
 606
 607
 608
 609
 610
 611
 612
 613
 614
 615
 616
 617
 618
 619
 620
 621
 622
 623
 624
 625
 626
 627
 628
 629
 630
 631
 632
 633
 634
 635
 636
 637
 638
 639
 640
 641
 642
 643
 644
 645
 646
 647
 648
 649
 650
 651
 652
 653
 654
 655
 656
 657
 658
 659
 660
 661
 662
 663
 664
 665
 666
 667
 668
 669
 670
 671
 672
 673
 674
 675
 676
 677
 678
 679
 680
 681
 682
 683
 684
 685
 686
 687
 688
 689
 690
 691
 692
 693
 694
 695
 696
 697
 698
 699
 700
 701
 702
 703
 704
 705
 706
 707
 708
 709
 710
 711
 712
 713
 714
 715
 716
 717
 718
 719
 720
 721
 722
 723
 724
 725
 726
 727
 728
 729
 730
 731
 732
 733
 734
 735
 736
 737
 738
 739
 740
 741
 742
 743
 744
 745
 746
 747
 748
 749
 750
 751
 752
 753
 754
 755
 756
 757
 758
 759
 760
 761
 762
 763
 764
 765
 766
 767
 768
 769
 770
 771
 772
 773
 774
 775
 776
 777
 778
 779
 780
 781
 782
 783
 784
 785
 786
 787
 788
 789
 790
 791
 792
 793
 794
 795
 796
 797
 798
 799
 800
 801
 802
 803
 804
 805
 806
 807
 808
 809
 810
 811
 812
 813
 814
 815
 816
 817
 818
 819
 820
 821
 822
 823
 824
 825
 826
 827
 828
 829
 830
 831
 832
 833
 834
 835
 836
 837
 838
 839
 840
 841
 842
 843
 844
 845
 846
 847
 848
 849
 850
 851
 852
 853
 854
 855
 856
 857
 858
 859
 860
 861
 862
 863
 864
 865
 866
 867
 868
 869
 870
 871
 872
 873
 874
 875
 876
 877
 878
 879
 880
 881
 882
 883
 884
 885
 886
 887
 888
 889
 890
 891
 892
 893
 894
 895
 896
 897
 898
 899
 900
 901
 902
 903
 904
 905
 906
 907
 908
 909
 910
 911
 912
 913
 914
 915
 916
 917
 918
 919
 920
 921
 922
 923
 924
 925
 926
 927
 928
 929
 930
 931
 932
 933
 934
 935
 936
 937
 938
 939
 940
 941
 942
 943
 944
 945
 946
 947
 948
 949
 950
 951
 952
 953
 954
 955
 956
 957
 958
 959
 960
 961
 962
 963
 964
 965
 966
 967
 968
 969
 970
 971
 972
 973
 974
 975
 976
 977
 978
 979
 980
 981
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
/* **********************************************************
 * Copyright 2009 VMware, Inc.  All rights reserved.
 * **********************************************************/

/*
 * @VMKAPIMOD_LICENSE@
 */

/*
 ***********************************************************************
 * Passthru                                                        */ /**
 * \addtogroup Network
 *@{
 * \defgroup Passthru Networking Passthrough
 *
 * Networking passthrough includes Uniform Passthrough (UPT) and
 * Network Plugin Architecture (NPA).
 *@{
 *
 ***********************************************************************
 */

#ifndef _VMKAPI_NET_PT_H_
#define _VMKAPI_NET_PT_H_

/** \cond never */
#ifndef VMK_HEADER_INCLUDED_FROM_VMKAPI_H
#error This vmkapi file should never be included directly but only via vmkapi.h
#endif
/** \endcond never */

#include "net/vmkapi_net_types.h"

/** Definition of maximum number passthrough regions for a VF */
#define VMK_VF_MAX_PT_REGIONS 6

/** Definition of RSS indirection table maximum size */
#define VMK_NETVF_RSS_MAX_IND_TABLE_SIZE 128

/** Definition of RSS hash key maximum size */
#define VMK_NETVF_RSS_MAX_KEY_SIZE 40

/** Maximum length of a plugin name */
#define VMK_NPA_MAX_PLUGIN_NAME_LEN 256

/** Maximum size of the plugin data (passed from PF driver to plugin)
    in 32-bit words */
#define VMK_NPA_MAX_PLUGIN_DATA_SIZE 32

/** Number of possible multicast MAC filters per VF (NPA) */
#define VMK_NPA_MAX_MULTICAST_FILTERS 32

/**
 * \ingroup Passthru
 * \brief VF identifier
 *
 * This identifier is uniqure among VFs owned by a PF
 */
typedef vmk_uint32 vmk_VFID;

/**
 * \ingroup Passthru
 * \brief VF Descriptor
 *
 * A VF descriptor uniquely identifies a VF on a host.
 */

typedef struct vmk_VFDesc {
   /** The PCI segment number of the PF */
   vmk_uint16  pfSegment;
   /** The PCI bus number of the PF */
   vmk_uint8   pfBus;
   /** The PCI device number of the PF */
   vmk_uint8   pfDev;
   /** The PCI function number of the PF */
   vmk_uint8   pfFunc;
   /** The identifier of the VF */
   vmk_uint32  vfID;
} vmk_VFDesc;

/**
 * \ingroup Passthru
 * \brief Passthru operations
 *
 * Each value corresponds to an operation that needs to be performed
 * by the driver.
 *
 * The driver is called through a callback of the following form:
 *
 * VMK_ReturnStatus (*vmk_UplinkPTOpFunc)(void *clientData, 
 *                                        vmk_NetPTOP op, 
 *                                        void *args);
 *
 * `clientData' is the device (struct net_device *) in the case of a
 * network driver.
 * `args' is a pointer to an operation-specific argument
 * structure. Please refer to the documentation of these structures
 * (vmk_NetPTOP...Args) to see which one match to each operation.
 */
typedef enum vmk_NetPTOP {
   /** Is passthrough supported */
   VMK_NETPTOP_IS_SUPPORTED           = 0x00000001,
  
   /** Allocate a VF */
   VMK_NETPTOP_VF_ACQUIRE             = 0x00000002,
  
   /** Initialize a VF */
   VMK_NETPTOP_VF_INIT                = 0x00000003,
  
   /** Activate a VF */
   VMK_NETPTOP_VF_ACTIVATE            = 0x00000004,
  
   /** Quiesce a VF */
   VMK_NETPTOP_VF_QUIESCE             = 0x00000005,
  
   /** Save state of a VF */
   VMK_NETPTOP_VF_SAVE_STATE          = 0x00000006,
  
   /** Release a VF */
   VMK_NETPTOP_VF_RELEASE             = 0x00000007,
  
   /** Get VF information */
   VMK_NETPTOP_VF_GET_INFO            = 0x00000008,
  
   /** Set RSS indirection table for a VF */
   VMK_NETPTOP_VF_SET_RSS_IND_TABLE   = 0x00000009,
  
   /** Get traffic statistics of a queue */
   VMK_NETPTOP_VF_GET_QUEUE_STATS     = 0x0000000a,
  
   /** Get status of a queue */
   VMK_NETPTOP_VF_GET_QUEUE_STATUS    = 0x0000000b,
  
   /** Set the MAC address of a VF */
   VMK_NETPTOP_VF_SET_MAC             = 0x0000000c,
  
   /** Set multicast MAC addresses filtered for a VF port */
   VMK_NETPTOP_VF_SET_MULTICAST       = 0x0000000d,
  
   /** Control RX mode of a VF port */
   VMK_NETPTOP_VF_SET_RX_MODE         = 0x0000000e,
  
   /** Add an authorized VLAN range to a VF port */
   VMK_NETPTOP_VF_ADD_VLAN_RANGE      = 0x0000000f,
  
   /** Remove an authorized VLAN range from a VF port */
   VMK_NETPTOP_VF_DEL_VLAN_RANGE      = 0x00000010,
  
   /** Setup VLAN insertion/stripping for a VF port */
   VMK_NETPTOP_VF_SET_DEFAULT_VLAN    = 0x00000011,
 
   /** Enable MAC-address anti-spoofing on a VF port */
   VMK_NETPTOP_VF_SET_ANTISPOOF       = 0x00000012,
  
   /** Set interrupt moderation for a VF */
   VMK_NETPTOP_VF_SET_IML             = 0x00000013,

   /** Add a MAC address filter to the PF */
   VMK_NETPTOP_PF_ADD_MAC_FILTER      = 0x00000014,
  
   /** Delete a MAC address filter from the PF */
   VMK_NETPTOP_PF_DEL_MAC_FILTER      = 0x00000015,
  
   /** Enable mirroring all traffic to the PF */
   VMK_NETPTOP_PF_MIRROR_ALL          = 0x00000016
 
} vmk_NetPTOP;

/**
 * \ingroup Passthru
 * \brief Enumeration of VF features.
 */
typedef enum vmk_NetVFFeatures {
   /** Supports RX checksum offload */
   VMK_NETVF_F_RXCSUM = 0x0001,
  
   /** Supports Receive Side Scaling */
   VMK_NETVF_F_RSS    = 0x0002,
  
   /** Supports RX VLAN acceleration */
   VMK_NETVF_F_RXVLAN = 0x0004,
  
   /** Supports Large Receive Offload */
   VMK_NETVF_F_LRO    = 0x0008
  
} vmk_NetVFFeatures;
  
/**
 * \ingroup Passthru
 * \brief Type for VF requested settings.
 *
 * This structure contains the main characteristics of a VF in the
 * case of VF allocation and initialization.
 *
 * The `version' field can be used to distinguish between the
 * different API versions on VF allocation (VMK_NETPTOP_VF_ACQUIRE).
 */
typedef struct vmk_NetVFRequirements {
   /** Version of the UPT/NPA code */
   vmk_uint32 version;
  
   /** Features requested */
   vmk_NetVFFeatures features;
  
   /** Features optionally requested */
   vmk_NetVFFeatures optFeatures;
  
   /** MTU requested */
   vmk_uint16 mtu;

   /** Number of TX queues requested */
   vmk_uint8 numTxQueues;

   /** Number of RX queues requested */
   vmk_uint8 numRxQueues;

   /** Number of requested interrupts */
   vmk_uint8 numIntrs;

   /** Reserved for future use */
   vmk_uint32 _rsvd[4];

} vmk_NetVFRequirements;

/**
 * \ingroup Passthru
 * \brief Enumeration of Interrupt Moderation Level (IML).
 */
typedef enum vmk_NetVFIML {
   /** No interrupt moderation */
   VMK_NETVF_IML_NONE = 0,
   
   /** Most interrupts generated */
   VMK_NETVF_IML_LOWEST = 1,

   /** Least interrupts generated */
   VMK_NETVF_IML_HIGHEST = 7,

   /** Adaptive moderation */
   VMK_NETVF_IML_ADAPTIVE = 8,

   /** Custom moderation */
   VMK_NETVF_IML_CUSTOM = 9,
} vmk_NetVFIML;

/**
 * \ingroup Passthru
 * \brief Type for ring descriptor (UPT only).
 *
 * This structure is used in UPT to save or restore the parameters of
 * a ring queue.
 */
typedef struct vmk_UPTVFRingDesc {
   /** Physical address of the ring */
   vmk_uint64 basePA;

   /** Number of descriptors */
   vmk_uint32 size;

   /** Index of the desriptor the producer will write to next */
   vmk_uint32 prodIdx;

   /** Index of the desriptor the consumer will read next */
   vmk_uint32 consIdx;

} vmk_UPTVFRingDesc;

/**
 * \ingroup Passthru
 * \brief Type for RX queue settings (UPT).
 *
 * This structure is used in UPT to initialize or restore the
 * parameters of a RX queue for a VF.
 */
typedef struct vmk_UPTVFRXQueueParams {
   /** First RX command ring */
   vmk_UPTVFRingDesc rxRing;

   /** Second RX command ring */
   vmk_UPTVFRingDesc rxRing2;

   /** RX completion ring */
   vmk_UPTVFRingDesc compRing;

   /** Value of GEN bit for the completion ring */
   vmk_uint32 compGen;

   /** Index of the MSI/MSI-X vector for this queue */
   vmk_uint8 intrIdx;

   /** Whether or not the queue is stopped */
   vmk_Bool stopped;

   /** Reserved for future use */
   vmk_uint32 _rsvd[4];

} vmk_UPTVFRXQueueParams;

/**
 * \ingroup Passthru
 * \brief Type for TX queue settings (UPT).
 *
 * This structure is used in UPT to initialize or restore the parameters of
 * a TX queue for a VF.
 */
typedef struct vmk_UPTVFTXQueueParams {
   /** TX command ring */
   vmk_UPTVFRingDesc txRing;

   /** TX data ring */
   vmk_UPTVFRingDesc dataRing;

   /** TX completion ring */
   vmk_UPTVFRingDesc compRing;

   /** Value of GEN bit for the completion ring */
   vmk_uint32 compGen;

   /** Index of the MSI/MSI-X vector for this queue */
   vmk_uint8 intrIdx;

   /** Whether or not the queue is stopped */
   vmk_Bool stopped;

   /** Reserved for future use */
   vmk_uint32 _rsvd[4];

} vmk_UPTVFTXQueueParams;

/**
 * \ingroup Passthru
 * \brief Type for queue settings (NPA).
 *
 * This structure is used in NPA to initialize a queue.
 *
 */
typedef struct vmk_NPAVFQueueParams {
   /** Physical address of the ring */
   vmk_uint64 basePA;

   /** Size of the ring */
   vmk_uint32 size;

   /** Length in bytes of the ring */
   vmk_ByteCountSmall length;

   /** Reserved for future use */
   vmk_uint32 _rsvd[4];

} vmk_NPAVFQueueParams;


/**
 * \ingroup Passthru
 * \brief Type for interrupt moderation settings.
 */

typedef struct vmk_VFIntrModParams {
   /** Interrupt moderation level for the vector. */
   vmk_NetVFIML modLevel;

   /** The interrupt rate, valid only if modLevel is VMK_NETVF_IML_CUSTOM */
   vmk_uint32 intrRate;

} vmk_VFIntrModParams;


/**
 * \ingroup Passthru
 * \brief Type for interrupt vector settings.
 *
 * This structure is used in UPT to initialize of restore an interrupt
 * vector's parameters for a VF.
 */
typedef struct vmk_UPTVFIntrVectorParams {
   /** Value of IMR for the vector */
   vmk_uint32 imr;

   /** Is there an interrupt pending on this vector? */
   vmk_Bool pending;

   /** Interrupt moderation parameter for this vector. */
   vmk_VFIntrModParams intrMod;

} vmk_UPTVFIntrVectorParams;

/**
 * \ingroup Passthru
 * \brief Type for interrupts settings (UPT).
 *
 * This structure is used in UPT to initialize or restore interrupts
 * parameters of a VF for each vector.
 */
typedef struct vmk_UPTVFIntrParams {
   /** Interrupt scheme to use */
   vmk_PCIInterruptType intrType;

   /** Whether or not auto mask is used */
   vmk_Bool autoMask;

   /** (array) Parameters specific to each vector */
   vmk_UPTVFIntrVectorParams *vectors;

   /** Reserved for future use */
   vmk_uint32 _rsvd[4];

} vmk_UPTVFIntrParams;

/**
 * \ingroup Passthru
 * \brief Type for interrupts settings (NPA).
 *
 * This structure is used in NPA to initialize an interrupts vector's
 * parameters.
 */
typedef struct vmk_NPAVFIntrParams {
   vmk_VFIntrModParams  intrMod;
} vmk_NPAVFIntrParams;

/**
 * \ingroup Passthru
 * \brief Enumeration of RSS hash types.
 */
typedef enum vmk_NetVFRSSHashType {
   /** Disable RSS */
   VMK_NETVF_HASH_TYPE_NONE     = 0x00,

   /** RSS hash based on IP */
   VMK_NETVF_HASH_TYPE_IPV4     = 0x01,

   /** RSS hash based on TCP (with IP) */
   VMK_NETVF_HASH_TYPE_TCP_IPV4 = 0x02,

   /** RSS hash based on IPv6 */
   VMK_NETVF_HASH_TYPE_IPV6     = 0x04,

   /** RSS hash based on TCP (with IPv6) */
   VMK_NETVF_HASH_TYPE_TCP_IPV6 = 0x08

} vmk_NetVFRSSHashType;

/**
 * \ingroup Passthru
 * \brief Enumeration of RSS hash functions.
 */
typedef enum vmk_NetVFRSSHashFunc {
   /** Disable RSS */
   VMK_NETVF_HASH_FUNC_NONE     = 0x00,
   /** Use Toeplitz hash function */
   VMK_NETVF_HASH_FUNC_TOEPLITZ = 0x01

} vmk_NetVFRSSHashFunc;

/**
 * \ingroup Passthru
 * \brief Type for RSS hash key.
 *
 * This structure is used to program the RSS hash key.
 */
typedef struct vmk_NetVFRSSHashKey {
   /** Size of the key */
   vmk_uint16 keySize;

   /** Contents */
   vmk_uint8 key[VMK_NETVF_RSS_MAX_KEY_SIZE];

} vmk_NetVFRSSHashKey;

/**
 * \ingroup Passthru
 * \brief Type for RSS indirection table.
 *
 * This structure is used to program or update the RSS indirection
 * table.
 */
typedef struct vmk_NetVFRSSIndTable {
   /** Size of the table */
   vmk_uint16 indTableSize;

   /** Contents */
   vmk_uint8 indTable[VMK_NETVF_RSS_MAX_IND_TABLE_SIZE];

} vmk_NetVFRSSIndTable;

/**
 * \ingroup Passthru
 * \brief Type for RSS configuration.
 *
 * This structure contains all the necessary settings to program a
 * VF's RSS engine.
 */
typedef struct vmk_NetVFRSSParams {
   /** Hash type to be used */
   vmk_NetVFRSSHashType hashType;

   /** Hash function to be used */
   vmk_NetVFRSSHashFunc hashFunc;

   /** Hash key */
   vmk_NetVFRSSHashKey key;

   /** Indirection table */
   vmk_NetVFRSSIndTable indTable;

} vmk_NetVFRSSParams;

/**
 * \ingroup Passthru
 * \brief Type for VF settings.
 *
 * This structure is used in both UPT and NPA to initialize or restore
 * (in the case of UPT) the settings of a VF, including RX, TX queues,
 * interrupt vectors, RSS and more.
 *
 * Since a driver can only be UPT or NPA but not both at a time, there
 * is no field to distinguish whether to use u.upt or u.npa in the
 * union. The driver must always be aware of whether it is doing UPT
 * or NPA.
 */
typedef struct vmk_NetVFParameters {
   /** Number of TX queues requested */
   vmk_uint8 numTxQueues;

   /** Number of RX queues requested */
   vmk_uint8 numRxQueues;

   /** Number of requested vectors */
   vmk_uint8 numIntrs;

   /** Parameters for RSS */
   vmk_NetVFRSSParams   rss;

   union {
      /** UPT specific parameters */
      struct {
         /** (array of numRxQueues) Parameters for each RX queue */
         vmk_UPTVFRXQueueParams *rxQueues;

         /** (array of numTxQueues) Parameters for each TX queue */
         vmk_UPTVFTXQueueParams *txQueues;

         /** Parameters for interrupts */
         vmk_UPTVFIntrParams intr;

         /** Number of OOB pages allocated */
         vmk_uint8 numOOBPages;

         /** The starting guest physical address of the OOB pages. OOB pages are mapped contiguously */
         vmk_uint64 OOBStartPA;

         /** The VMkernel virtual address used to access the OOB pages */
         void *OOBMapped;

      } upt;

      /** NPA specific parameters */
      struct {
         /** (array of numRxQueues) Parameters for each RX queue */
         vmk_NPAVFQueueParams *rxQueues;

         /** (array of numTxQueues) Parameters for each TX queue */
         vmk_NPAVFQueueParams *txQueues;

         /** (array of numIntrs) Parameters for interrupts */
         vmk_NPAVFIntrParams *intr;

         /** Memory region shared with the plugin */
         void *sharedRegion;

         /** Length of the shared region in bytes */
         vmk_ByteCountSmall sharedRegionLength;

      } npa;

   } u;

   /** Features requested */
   vmk_NetVFFeatures features;
  
   /** Features optionally requested */
   vmk_NetVFFeatures optFeatures;
  
   /** MTU requested */
   vmk_uint16 mtu;

   /** Reserved for future use */
   vmk_uint8 _rsvd[6];

} vmk_NetVFParameters;

/**
 * \ingroup Passthru
 * \brief Type for VF passthrough MMIO region.
 */
typedef struct vmk_VFPTRegion {
   /** Region address */
   vmk_uint64 MA;

   /** Region size in pages */
   vmk_uint32 numPages;
} vmk_VFPTRegion;

/**
 * \ingroup Passthru
 * \brief Type for VF info.
 *
 * This structure is used to retrieve VF's information, including
 * passthrough regions, device address on the bus (SBDF), plugin
 * information etc...
 */
typedef struct vmk_NetVFInfo {
   /** Address and size of passthrough MMIO regions */
   vmk_VFPTRegion ptRegions[VMK_VF_MAX_PT_REGIONS];

   /** Number of regions used */
   vmk_uint8 numPtRegions;

   /** Segment,Bus,Device,Function of the VF */
   vmk_uint32 sbdf;

   union {
      /** UPT specific information */
      struct {
         /** The device revision */
         vmk_uint32 devRevision;

         /** Reserved, must set to 0 */
         vmk_uint32 reserved;

         /** The size of the out-of-band DMA buffer needed, in pages */
         vmk_uint8 numOOBPages;
      } upt;

      /** NPA specific information */
      struct {
         /** Plugin name */
         char pluginName[VMK_NPA_MAX_PLUGIN_NAME_LEN];

         /** Some opaque data to be passed to the plugin */
         vmk_uint32 pluginData[VMK_NPA_MAX_PLUGIN_DATA_SIZE];
      } npa;

   } u;

   /** Reserved for future use */
   vmk_uint32 _rsvd[4];

} vmk_NetVFInfo;

/**
 * \ingroup Passthru
 * \brief Enumeration of queue types.
 */
typedef enum vmk_NetVFQueueType {
   /** Queue is RX */
   VMK_NETVF_QUEUE_TYPE_RX,

   /** Queue is TX */
   VMK_NETVF_QUEUE_TYPE_TX

} vmk_NetVFQueueType;

/**
 * \ingroup Passthru
 * \brief Type for RX statistics for a queue.
 *
 * This structure is used to save, restore or retrieve statistics of
 * a VF's RX queue.
 */
typedef struct vmk_NetVFRXQueueStats {
   /** Unicast packets received */
   vmk_uint64 unicastPkts;

   /** Unicast bytes received */
   vmk_uint64 unicastBytes;

   /** Multicast packets received */
   vmk_uint64 multicastPkts;

   /** Multicast bytes received */
   vmk_uint64 multicastBytes;

   /** Broadcast packets received */
   vmk_uint64 broadcastPkts;

   /** Broadcast bytes received */
   vmk_uint64 broadcastBytes;

   /** Packets dropped due to buffer shortage */
   vmk_uint64 outOfBufferDrops;

   /** Packets dropped due to other errors */
   vmk_uint64 errorDrops;

   /** Number of packets aggregated by LRO */
   vmk_uint64 LROPkts;

   /** Bytes received from LRO packets */
   vmk_uint64 LROBytes;

   /** Reserved for future use */
   vmk_uint32 _rsvd[4];

} vmk_NetVFRXQueueStats;

/**
 * \ingroup Passthru
 * \brief Type for storing RX statistics for a queue.
 *
 * This structure is used to save, restore or retrieve statistics of
 * a VF's TX queue.
 */
typedef struct vmk_NetVFTXQueueStats {
   /** Unicast packets transmitted */
   vmk_uint64 unicastPkts;

   /** Unicast bytes transmitted */
   vmk_uint64 unicastBytes;

   /** Multicast packets transmitted */
   vmk_uint64 multicastPkts;

   /** Multicast bytes transmitted */
   vmk_uint64 multicastBytes;

   /** Broadcast packets transmitted */
   vmk_uint64 broadcastPkts;

   /** Broadcast bytes transmitted */
   vmk_uint64 broadcastBytes;

   /** Packets failed to transmit */
   vmk_uint64 errors;

   /** Packets discarded */
   vmk_uint64 discards;

   /** Number of TSO packets transmitted */
   vmk_uint64 TSOPkts;

   /** Number of bytes transmitted in TSO packets */
   vmk_uint64 TSOBytes;

   /** Reserved for future use */
   vmk_uint32 _rsvd[4];

} vmk_NetVFTXQueueStats;

/**
 * \ingroup Passthru
 * \brief Type for storing the status of a queue.
 *
 * This structure is query the status of a TX or RX queue.
 */
typedef struct vmk_NetVFQueueStatus {
   /** Is the queue stopped */
   vmk_Bool stopped;

   /** Vendor-specific error code */
   vmk_uint32 error;

   /** Reserved for future use */
   vmk_uint32 _rsvd[4];

} vmk_NetVFQueueStatus;

/**
 * \ingroup Passthru
 * \brief Type for the state saved for a TX queue (UPT).
 *
 * This structure is used by UPT to save the state of a TX queue.
 */
typedef struct vmk_UPTTXQueueSaveState {
   /** The index of the tx command descriptor the device will read next */
   vmk_uint32  txProd;

   /** The index of the tx command descriptor the driver will write to next */
   vmk_uint32  txCons;

   /** The index of the tx completion descriptor the device will write
       to next */
   vmk_uint32  tcProd;

   /** The value of the GEN bit the device will write to the next tx
       completion descriptor */
   vmk_uint32  tcGen;

   /** The stats maintained by a tx queue */
   vmk_NetVFTXQueueStats stats;

   /** Is the queue stopped */
   vmk_Bool stopped;

   /** Vendor-specific error code for stoppage */
   vmk_uint32 error;

   /** Reserved for future use */
   vmk_uint32 _rsvd[4];

} vmk_UPTTXQueueSaveState;

/**
 * \ingroup Passthru
 * \brief Type for the state saved for a RX queue (UPT).
 *
 * This structure is used by UPT to save the state of a TX queue.
 */
typedef struct vmk_UPTRXQueueSaveState {
   /** The index of the next rx command descriptor the driver will write to */
   vmk_uint32 rxProd;

   /** The index of the next rx command descriptor the device will
       receive pkts into */
   vmk_uint32 rxCons;

   /** The index of the next rx command descriptor in the 2nd ring the
       driver will write to */
   vmk_uint32 rxProd2;

   /** The index of the next rx command descriptor in the 2nd ring the
       device will receive pkts into */
   vmk_uint32 rxCons2;

   /** The index of the next rx completion descriptor the device will
       write to */
   vmk_uint32 rcProd;

   /** The value of the GEN bit the device will write to the next rx
       completion descriptor  */
   vmk_uint32 rcGen;

   /** The stats maintained by a rx queue */
   vmk_NetVFRXQueueStats stats;

   /** Is the queue stopped */
   vmk_Bool stopped;

   /** Vendor-specific error code for stoppage */
   vmk_uint32 error;

   /** Reserved for future use */
   vmk_uint32 _rsvd[4];

} vmk_UPTRXQueueSaveState;

/**
 * \ingroup Passthru
 * \brief Type for the state saved for the interrupt unit (UPT).
 *
 * This structure is used by UPT to save the state of a VF's interrupt
 * vector.
 */
typedef struct vmk_UPTIntrSaveState {
   /** The value of IMR for the i-th intr */
   vmk_uint32 imr;

   /** Reserved for future use */
   vmk_uint32 _rsvd[2];

} vmk_UPTIntrSaveState; 

/**
 * \ingroup Passthru
 * \brief Type for storing VF state (UPT).
 *
 * This structure is used by UPT to store the entire state of a VF,
 * including RX/TX queues state and interrupt state.
 */
typedef struct vmk_UPTVFSaveState {
   /** The number of tx queues */
   vmk_uint8        numTxQueues;

   /** The number of rx queues */
   vmk_uint8        numRxQueues;

   /** The number of intrs configured */
   vmk_uint32       numIntrs;

   /** The state of the tx queues */
   vmk_UPTTXQueueSaveState *tqState;

   /** The state of the rx queues */
   vmk_UPTRXQueueSaveState *rqState;

   /** The state of the intr unit */
   vmk_UPTIntrSaveState *intrState;

   /** Reserved for future use */
   vmk_uint32 _rsvd[4];

} vmk_UPTVFSaveState;

/**
 * \ingroup Passthru
 * \brief Arguments for the VF Acquire operation.
 *
 * This structure is passed as argument of the NETPTOP_VF_ACQUIRE
 * operation. It contains the required features on the VF being
 * allocated.
 */
typedef struct vmk_NetPTOPVFAcquireArgs {
   /** Requested options for the VF */
   vmk_NetVFRequirements props;

   /** (output) Identifier of the allocated VF */
   vmk_VFID vf;

} vmk_NetPTOPVFAcquireArgs;

/**
 * \ingroup Passthru
 * \brief Arguments for the VF Init operation.
 *
 * This structure is passed as argument of the NETPTOP_VF_INIT
 * operation. It contains the settings used to initialize the VF.
 */
typedef struct vmk_NetPTOPVFInitArgs {
   /** VF id */
   vmk_VFID vf;

   /** Parameters for the VF */
   vmk_NetVFParameters params;

} vmk_NetPTOPVFInitArgs;

/**
 * \ingroup Passthru
 * \brief Arguments for the VF Activate, Quiesce and Release operations.
 *
 * This structure is passed as an argument of the NETPTOP_VF_ACTIVATE,
 * NETPTOP_VF_QUIESCE and NETPTOP_VF_RELEASE operations.
 */
typedef struct vmk_NetPTOPVFSimpleArgs {
   /** VF id */
   vmk_VFID vf;

} vmk_NetPTOPVFSimpleArgs;

/**
 * \ingroup Passthru
 * \brief Arguments for VF Save State operation.
 *
 * This structure is passed as argument of UPT's NETPTOP_VF_SAVE_STATE
 * operation. The driver must fill the `state' structure with the
 * current state of the VF.
 */
typedef struct vmk_NetPTOPVFSaveStateArgs {
   /** VF id */
   vmk_VFID vf;

   /** (output) VF state */
   vmk_UPTVFSaveState state;

} vmk_NetPTOPVFSaveStateArgs;

/**
 * \ingroup Passthru
 * \brief Arguments for the VF Get Info operation.
 *
 * This structure is passed as argument of NETPTOP_VF_GET_INFO
 * operation and have to be filled (`info' structure) by the driver.
 */
typedef struct vmk_NetPTOPVFGetInfoArgs {
   /** VF id */
   vmk_VFID vf;

   /** (output) Information of the VF */
   vmk_NetVFInfo info;

} vmk_NetPTOPVFGetInfoArgs;

/**
 * \ingroup Passthru
 * \brief Arguments for the VF Set Indirection Table operation.
 *
 * This structure is passed as argument of the
 * NETPTOP_VF_SET_RSS_IND_TABLE operation and contains the updated RSS
 * indirection table for the VF.
 */
typedef struct vmk_NetPTOPVFSetRSSIndTableArgs {
   /** VF id */
   vmk_VFID vf;

   /** RSS Indirection table for the VF */
   vmk_NetVFRSSIndTable table;

} vmk_NetPTOPVFSetRSSIndTableArgs;

/**
 * \ingroup Passthru
 * \brief Arguments for the VF Get Queue Stats operation.
 *
 * This structure is passed as argument of the
 * NETPTOP_VF_GET_QUEUE_STATS operation. It has to be allocated by the
 * caller and `vf', `numTxQueues' and `numRxQueues' must be set
 * properly. The driver then put the statistics of each queue in the
 * `tqStats' and `rqStats' arrays.
 */
typedef struct vmk_NetPTOPVFGetQueueStatsArgs {
   /** VF id */
   vmk_VFID vf;

   /** Number of TX queues requested */
   vmk_uint8 numTxQueues;

   /** Number of RX queues requested */
   vmk_uint8 numRxQueues;

   /** (output) Statistics from the TX queues. Buffer is allocated and zeroed by the caller */
   vmk_NetVFTXQueueStats *tqStats;

   /** (output) Statistics from the RX queues. Buffer is allocated and zeroed by the caller */
   vmk_NetVFRXQueueStats *rqStats;
} vmk_NetPTOPVFGetQueueStatsArgs;

/**
 * \ingroup Passthru
 * \brief Arguments for the VF Get Queue Status operation.
 *
 * This structure is passed as argument of the
 * NETPTOP_VF_GET_QUEUE_STATUS to query the status of a VF's queue.
 * It has to be allocated by the caller and `vf', `numTxQueues' and
 * `numRxQueues' must be set properly. The driver then put the status
 * of each queue in the `tqStatus' and `rqStatus' arrays.
 */
typedef struct vmk_NetPTOPVFGetQueueStatusArgs {
   /** VF id */
   vmk_VFID vf;

   /** Number of TX queues requested */
   vmk_uint8 numTxQueues;

   /** Number of RX queues requested */
   vmk_uint8 numRxQueues;

   /** (output) Status for the TX queues. Buffer is allocated and zeroed by the caller */
   vmk_NetVFQueueStatus *tqStatus;

   /** (output) Status for the RX queues. Buffer is allocated and zeroed by the caller */
   vmk_NetVFQueueStatus *rqStatus;

} vmk_NetPTOPVFGetQueueStatusArgs;

/**
 * \ingroup Passthru
 * \brief Arguments for the VF Set Mac operation.
 *
 * This structure is passed to the NETPTOP_VF_SET_MAC operation and
 * configures or updates the MAC address of a VF.
 */
typedef struct vmk_NetPTOPVFSetMacArgs {
   /** VF id */
   vmk_VFID vf;

   /** MAC address */
   vmk_EthAddress mac;

} vmk_NetPTOPVFSetMacArgs;

/**
 * \ingroup Passthru
 * \brief Arguments for the VF Set Multicast operation.
 *
 * This structure is passed to the NETPTOP_VF_SET_MULTICAST operation
 * and sets the list of multicast addresses to receive packets on.
 */
typedef struct vmk_NetPTOPVFSetMulticastArgs {
   /** VF id */
   vmk_VFID vf;

   /** Number of MAC filters contained in the `mac' array */
   vmk_ByteCount nmac;

   /** MAC addresses */
   vmk_EthAddress macList[VMK_NPA_MAX_MULTICAST_FILTERS];

   /** Reserved for future use */
   vmk_uint32 _rsvd[4];

} vmk_NetPTOPVFSetMulticastArgs;

/**
 * \ingroup Passthru
 * \brief Arguments for the VF Set RX Mode operation.
 *
 * This structure is passed as argument of the NETPTOP_VF_SET_RX_MODE
 * operation and sets or update the RX filtering options of a VF.
 */
typedef struct vmk_NetPTOPVFSetRxModeArgs {
   /** VF id */
   vmk_VFID vf;

   /** Enable unicast receive filter */
   vmk_Bool unicast;

   /** Enable multicast receive filter(s) */
   vmk_Bool multicast;

   /** Enable accepting broadcast */
   vmk_Bool broadcast;

   /** Enable multicast promiscuous mode */
   vmk_Bool allmulti;

   /** Enable promiscuous mode */
   vmk_Bool promiscuous;

} vmk_NetPTOPVFSetRxModeArgs;

/**
 * \ingroup Passthru
 * \brief Arguments for the Add Vlan Range and Del Vlan Range operations.
 *
 * This structure is used both for the NETPTOP_VF_ADD_VLAN_RANGE and
 * NETPTOP_VF_DEL_VLAN_RANGE to enable or disable forwarding of a
 * given range of VLANs to a VF.
 */
typedef struct vmk_NetPTOPVFVlanRangeArgs {
   /** VF id */
   vmk_VFID vf;

   /** starting vlan ID */
   vmk_VlanID first;

   /** ending vlan ID (included) */
   vmk_VlanID last;

} vmk_NetPTOPVFVlanRangeArgs;

/**
 * \ingroup Passthru
 * \brief Arguments for the VF Set Default Vlan operation.
 *
  This structure is passed as argument of the
  NETPTOP_VF_SET_DEFAULT_VLAN operation to enable or disable 802.1
  VLAN tag/priority insertion and stripping.
 */
typedef struct vmk_NetPTOPVFSetDefaultVlanArgs {
   /** VF id */
   vmk_VFID vf;

   /** Enable/disable */
   vmk_Bool enable;

   /** VLAN id to insert */
   vmk_VlanID vid;

   /** Priority value */
   vmk_VlanPriority prio;

} vmk_NetPTOPVFSetDefaultVlanArgs;

/**
 * \ingroup Passthru
 * \brief Arguments for the VF Set Antispoof operation.
 *
 * This structure is passed as argument of the
 * NETPTOP_VF_SET_ANTISPOOF operation to enable or disable source MAC
 * address enforcement in the 802.3 header.
 */
typedef struct vmk_NetPTOPVFSetAntispoofArgs {
   /** VF id */
   vmk_VFID vf;

   /** Enable MAC anti-spoofing */
   vmk_Bool enable;

} vmk_NetPTOPVFSetAntispoofArgs;


/**
 * \ingroup Passthru
 * \brief Arguments for VMK_NETPTOP_VF_SET_IML operation
 *
 * This simple structure is used to set the interrupt moderation for a VF.
 */

typedef struct vmk_NETPTOPVFSetIMLArgs {
   /** Number of vectors */
   vmk_uint8  numIntrs;

   /** (array of numIntrs) Interrupt moderation parameters for the vector. */
   vmk_VFIntrModParams *intrMod;

} vmk_NETPTOPVFSetIMLArgs;


/**
 * \ingroup Passthru
 * \brief Arguments for the PF Add Mac Filter and Del Mac Filter operations.
 *
 * This simple structure is used for both NETPTOP_PF_ADD_MAC_FILTER
 * and NETPTOP_PF_DEL_MAC_FILTER operations to insert or remove a MAC
 * address filter on the default queue.
 */
typedef struct vmk_NetPTOPPFMacFilterArgs {
   /** MAC address */
   vmk_EthAddress mac;

} vmk_NetPTOPPFMacFilterArgs;

/**
 * \ingroup Passthru
 * \brief Arguments for the PF Mirror All operation.
 *
 * This simple structure is passed to the NETPTOP_PF_MIRROR_ALL
 * operation and enables or disables the mirroring of all traffic to
 * the default queue.
 */
typedef struct vmk_NetPTOPPFMirrorAllArgs {
   /** Enable mirroring */
   vmk_Bool enable;

} vmk_NetPTOPPFMirrorAllArgs;

#endif /* _VMKAPI_NET_PT_H_ */
/** @} */
/** @} */