aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/marvell/octeontx2/af/rvu_struct.h
blob: 445dfc328a8d4888d25a78c754b5e76275408da2 (plain)
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
/* SPDX-License-Identifier: GPL-2.0
 * Marvell OcteonTx2 RVU Admin Function driver
 *
 * Copyright (C) 2018 Marvell International Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */

#ifndef RVU_STRUCT_H
#define RVU_STRUCT_H

/* RVU Block revision IDs */
#define RVU_BLK_RVUM_REVID		0x01

/* RVU Block Address Enumeration */
enum rvu_block_addr_e {
	BLKADDR_RVUM		= 0x0ULL,
	BLKADDR_LMT		= 0x1ULL,
	BLKADDR_MSIX		= 0x2ULL,
	BLKADDR_NPA		= 0x3ULL,
	BLKADDR_NIX0		= 0x4ULL,
	BLKADDR_NIX1		= 0x5ULL,
	BLKADDR_NPC		= 0x6ULL,
	BLKADDR_SSO		= 0x7ULL,
	BLKADDR_SSOW		= 0x8ULL,
	BLKADDR_TIM		= 0x9ULL,
	BLKADDR_CPT0		= 0xaULL,
	BLKADDR_CPT1		= 0xbULL,
	BLKADDR_NDC_NIX0_RX	= 0xcULL,
	BLKADDR_NDC_NIX0_TX	= 0xdULL,
	BLKADDR_NDC_NPA0	= 0xeULL,
	BLK_COUNT		= 0xfULL,
};

/* RVU Block Type Enumeration */
enum rvu_block_type_e {
	BLKTYPE_RVUM = 0x0,
	BLKTYPE_MSIX = 0x1,
	BLKTYPE_LMT  = 0x2,
	BLKTYPE_NIX  = 0x3,
	BLKTYPE_NPA  = 0x4,
	BLKTYPE_NPC  = 0x5,
	BLKTYPE_SSO  = 0x6,
	BLKTYPE_SSOW = 0x7,
	BLKTYPE_TIM  = 0x8,
	BLKTYPE_CPT  = 0x9,
	BLKTYPE_NDC  = 0xa,
	BLKTYPE_MAX  = 0xa,
};

/* RVU Admin function Interrupt Vector Enumeration */
enum rvu_af_int_vec_e {
	RVU_AF_INT_VEC_POISON = 0x0,
	RVU_AF_INT_VEC_PFFLR  = 0x1,
	RVU_AF_INT_VEC_PFME   = 0x2,
	RVU_AF_INT_VEC_GEN    = 0x3,
	RVU_AF_INT_VEC_MBOX   = 0x4,
	RVU_AF_INT_VEC_CNT    = 0x5,
};

/* NPA Admin function Interrupt Vector Enumeration */
enum npa_af_int_vec_e {
	NPA_AF_INT_VEC_RVU	= 0x0,
	NPA_AF_INT_VEC_GEN	= 0x1,
	NPA_AF_INT_VEC_AQ_DONE	= 0x2,
	NPA_AF_INT_VEC_AF_ERR	= 0x3,
	NPA_AF_INT_VEC_POISON	= 0x4,
	NPA_AF_INT_VEC_CNT	= 0x5,
};

/* NIX Admin function Interrupt Vector Enumeration */
enum nix_af_int_vec_e {
	NIX_AF_INT_VEC_RVU	= 0x0,
	NIX_AF_INT_VEC_GEN	= 0x1,
	NIX_AF_INT_VEC_AQ_DONE	= 0x2,
	NIX_AF_INT_VEC_AF_ERR	= 0x3,
	NIX_AF_INT_VEC_POISON	= 0x4,
	NIX_AF_INT_VEC_CNT	= 0x5,
};

/* SSO Admin function Interrupt Vector Enumeration */
enum sso_af_int_vec_e {
	SSO_AF_INT_VEC_ERR0 = 0x0,
	SSO_AF_INT_VEC_ERR2 = 0x1,
	SSO_AF_INT_VEC_RAS  = 0x2,
	SSO_AF_INT_VEC_CNT  = 0x3,
};

/* CPT Admin function Interrupt Vector Enumeration */
enum cpt_af_int_vec_e {
	CPT_AF_INT_VEC_FLT0	= 0x0,
	CPT_AF_INT_VEC_FLT1	= 0x1,
	CPT_AF_INT_VEC_RVU	= 0x2,
	CPT_AF_INT_VEC_RAS	= 0x3,
	CPT_AF_INT_VEC_CNT	= 0x4,
};

/**
 * RVU PF Interrupt Vector Enumeration
 */
enum rvu_pf_int_vec_e {
	RVU_PF_INT_VEC_VFFLR0     = 0x0,
	RVU_PF_INT_VEC_VFFLR1     = 0x1,
	RVU_PF_INT_VEC_VFME0      = 0x2,
	RVU_PF_INT_VEC_VFME1      = 0x3,
	RVU_PF_INT_VEC_VFPF_MBOX0 = 0x4,
	RVU_PF_INT_VEC_VFPF_MBOX1 = 0x5,
	RVU_PF_INT_VEC_AFPF_MBOX  = 0x6,
	RVU_PF_INT_VEC_CNT	  = 0x7,
};

/* NPA admin queue completion enumeration */
enum npa_aq_comp {
	NPA_AQ_COMP_NOTDONE    = 0x0,
	NPA_AQ_COMP_GOOD       = 0x1,
	NPA_AQ_COMP_SWERR      = 0x2,
	NPA_AQ_COMP_CTX_POISON = 0x3,
	NPA_AQ_COMP_CTX_FAULT  = 0x4,
	NPA_AQ_COMP_LOCKERR    = 0x5,
};

/* NPA admin queue context types */
enum npa_aq_ctype {
	NPA_AQ_CTYPE_AURA = 0x0,
	NPA_AQ_CTYPE_POOL = 0x1,
};

/* NPA admin queue instruction opcodes */
enum npa_aq_instop {
	NPA_AQ_INSTOP_NOP    = 0x0,
	NPA_AQ_INSTOP_INIT   = 0x1,
	NPA_AQ_INSTOP_WRITE  = 0x2,
	NPA_AQ_INSTOP_READ   = 0x3,
	NPA_AQ_INSTOP_LOCK   = 0x4,
	NPA_AQ_INSTOP_UNLOCK = 0x5,
};

/* ALLOC/FREE input queues Enumeration from coprocessors */
enum npa_inpq {
	NPA_INPQ_NIX0_RX       = 0x0,
	NPA_INPQ_NIX0_TX       = 0x1,
	NPA_INPQ_NIX1_RX       = 0x2,
	NPA_INPQ_NIX1_TX       = 0x3,
	NPA_INPQ_SSO           = 0x4,
	NPA_INPQ_TIM           = 0x5,
	NPA_INPQ_DPI           = 0x6,
	NPA_INPQ_AURA_OP       = 0xe,
	NPA_INPQ_INTERNAL_RSV  = 0xf,
};

/* NPA admin queue instruction structure */
struct npa_aq_inst_s {
#if defined(__BIG_ENDIAN_BITFIELD)
	u64 doneint               : 1;	/* W0 */
	u64 reserved_44_62        : 19;
	u64 cindex                : 20;
	u64 reserved_17_23        : 7;
	u64 lf                    : 9;
	u64 ctype                 : 4;
	u64 op                    : 4;
#else
	u64 op                    : 4;
	u64 ctype                 : 4;
	u64 lf                    : 9;
	u64 reserved_17_23        : 7;
	u64 cindex                : 20;
	u64 reserved_44_62        : 19;
	u64 doneint               : 1;
#endif
	u64 res_addr;			/* W1 */
};

/* NPA admin queue result structure */
struct npa_aq_res_s {
#if defined(__BIG_ENDIAN_BITFIELD)
	u64 reserved_17_63        : 47; /* W0 */
	u64 doneint               : 1;
	u64 compcode              : 8;
	u64 ctype                 : 4;
	u64 op                    : 4;
#else
	u64 op                    : 4;
	u64 ctype                 : 4;
	u64 compcode              : 8;
	u64 doneint               : 1;
	u64 reserved_17_63        : 47;
#endif
	u64 reserved_64_127;		/* W1 */
};

struct npa_aura_s {
	u64 pool_addr;			/* W0 */
#if defined(__BIG_ENDIAN_BITFIELD)	/* W1 */
	u64 avg_level             : 8;
	u64 reserved_118_119      : 2;
	u64 shift                 : 6;
	u64 aura_drop             : 8;
	u64 reserved_98_103       : 6;
	u64 bp_ena                : 2;
	u64 aura_drop_ena         : 1;
	u64 pool_drop_ena         : 1;
	u64 reserved_93           : 1;
	u64 avg_con               : 9;
	u64 pool_way_mask         : 16;
	u64 pool_caching          : 1;
	u64 reserved_65           : 2;
	u64 ena                   : 1;
#else
	u64 ena                   : 1;
	u64 reserved_65           : 2;
	u64 pool_caching          : 1;
	u64 pool_way_mask         : 16;
	u64 avg_con               : 9;
	u64 reserved_93           : 1;
	u64 pool_drop_ena         : 1;
	u64 aura_drop_ena         : 1;
	u64 bp_ena                : 2;
	u64 reserved_98_103       : 6;
	u64 aura_drop             : 8;
	u64 shift                 : 6;
	u64 reserved_118_119      : 2;
	u64 avg_level             : 8;
#endif
#if defined(__BIG_ENDIAN_BITFIELD)	/* W2 */
	u64 reserved_189_191      : 3;
	u64 nix1_bpid             : 9;
	u64 reserved_177_179      : 3;
	u64 nix0_bpid             : 9;
	u64 reserved_164_167      : 4;
	u64 count                 : 36;
#else
	u64 count                 : 36;
	u64 reserved_164_167      : 4;
	u64 nix0_bpid             : 9;
	u64 reserved_177_179      : 3;
	u64 nix1_bpid             : 9;
	u64 reserved_189_191      : 3;
#endif
#if defined(__BIG_ENDIAN_BITFIELD)	/* W3 */
	u64 reserved_252_255      : 4;
	u64 fc_hyst_bits          : 4;
	u64 fc_stype              : 2;
	u64 fc_up_crossing        : 1;
	u64 fc_ena                : 1;
	u64 reserved_240_243      : 4;
	u64 bp                    : 8;
	u64 reserved_228_231      : 4;
	u64 limit                 : 36;
#else
	u64 limit                 : 36;
	u64 reserved_228_231      : 4;
	u64 bp                    : 8;
	u64 reserved_240_243      : 4;
	u64 fc_ena                : 1;
	u64 fc_up_crossing        : 1;
	u64 fc_stype              : 2;
	u64 fc_hyst_bits          : 4;
	u64 reserved_252_255      : 4;
#endif
	u64 fc_addr;			/* W4 */
#if defined(__BIG_ENDIAN_BITFIELD)	/* W5 */
	u64 reserved_379_383      : 5;
	u64 err_qint_idx          : 7;
	u64 reserved_371          : 1;
	u64 thresh_qint_idx       : 7;
	u64 reserved_363          : 1;
	u64 thresh_up             : 1;
	u64 thresh_int_ena        : 1;
	u64 thresh_int            : 1;
	u64 err_int_ena           : 8;
	u64 err_int               : 8;
	u64 update_time           : 16;
	u64 pool_drop             : 8;
#else
	u64 pool_drop             : 8;
	u64 update_time           : 16;
	u64 err_int               : 8;
	u64 err_int_ena           : 8;
	u64 thresh_int            : 1;
	u64 thresh_int_ena        : 1;
	u64 thresh_up             : 1;
	u64 reserved_363          : 1;
	u64 thresh_qint_idx       : 7;
	u64 reserved_371          : 1;
	u64 err_qint_idx          : 7;
	u64 reserved_379_383      : 5;
#endif
#if defined(__BIG_ENDIAN_BITFIELD)	/* W6 */
	u64 reserved_420_447      : 28;
	u64 thresh                : 36;
#else
	u64 thresh                : 36;
	u64 reserved_420_447      : 28;
#endif
	u64 reserved_448_511;		/* W7 */
};

struct npa_pool_s {
	u64 stack_base;			/* W0 */
#if defined(__BIG_ENDIAN_BITFIELD)	/* W1 */
	u64 reserved_115_127      : 13;
	u64 buf_size              : 11;
	u64 reserved_100_103      : 4;
	u64 buf_offset            : 12;
	u64 stack_way_mask        : 16;
	u64 reserved_70_71        : 3;
	u64 stack_caching         : 1;
	u64 reserved_66_67        : 2;
	u64 nat_align             : 1;
	u64 ena                   : 1;
#else
	u64 ena                   : 1;
	u64 nat_align             : 1;
	u64 reserved_66_67        : 2;
	u64 stack_caching         : 1;
	u64 reserved_70_71        : 3;
	u64 stack_way_mask        : 16;
	u64 buf_offset            : 12;
	u64 reserved_100_103      : 4;
	u64 buf_size              : 11;
	u64 reserved_115_127      : 13;
#endif
#if defined(__BIG_ENDIAN_BITFIELD)	/* W2 */
	u64 stack_pages           : 32;
	u64 stack_max_pages       : 32;
#else
	u64 stack_max_pages       : 32;
	u64 stack_pages           : 32;
#endif
#if defined(__BIG_ENDIAN_BITFIELD)	/* W3 */
	u64 reserved_240_255      : 16;
	u64 op_pc                 : 48;
#else
	u64 op_pc                 : 48;
	u64 reserved_240_255      : 16;
#endif
#if defined(__BIG_ENDIAN_BITFIELD)	/* W4 */
	u64 reserved_316_319      : 4;
	u64 update_time           : 16;
	u64 reserved_297_299      : 3;
	u64 fc_up_crossing        : 1;
	u64 fc_hyst_bits          : 4;
	u64 fc_stype              : 2;
	u64 fc_ena                : 1;
	u64 avg_con               : 9;
	u64 avg_level             : 8;
	u64 reserved_270_271      : 2;
	u64 shift                 : 6;
	u64 reserved_260_263      : 4;
	u64 stack_offset          : 4;
#else
	u64 stack_offset          : 4;
	u64 reserved_260_263      : 4;
	u64 shift                 : 6;
	u64 reserved_270_271      : 2;
	u64 avg_level             : 8;
	u64 avg_con               : 9;
	u64 fc_ena                : 1;
	u64 fc_stype              : 2;
	u64 fc_hyst_bits          : 4;
	u64 fc_up_crossing        : 1;
	u64 reserved_297_299      : 3;
	u64 update_time           : 16;
	u64 reserved_316_319      : 4;
#endif
	u64 fc_addr;			/* W5 */
	u64 ptr_start;			/* W6 */
	u64 ptr_end;			/* W7 */
#if defined(__BIG_ENDIAN_BITFIELD)	/* W8 */
	u64 reserved_571_575      : 5;
	u64 err_qint_idx          : 7;
	u64 reserved_563          : 1;
	u64 thresh_qint_idx       : 7;
	u64 reserved_555          : 1;
	u64 thresh_up             : 1;
	u64 thresh_int_ena        : 1;
	u64 thresh_int            : 1;
	u64 err_int_ena           : 8;
	u64 err_int               : 8;
	u64 reserved_512_535      : 24;
#else
	u64 reserved_512_535      : 24;
	u64 err_int               : 8;
	u64 err_int_ena           : 8;
	u64 thresh_int            : 1;
	u64 thresh_int_ena        : 1;
	u64 thresh_up             : 1;
	u64 reserved_555          : 1;
	u64 thresh_qint_idx       : 7;
	u64 reserved_563          : 1;
	u64 err_qint_idx          : 7;
	u64 reserved_571_575      : 5;
#endif
#if defined(__BIG_ENDIAN_BITFIELD)	/* W9 */
	u64 reserved_612_639      : 28;
	u64 thresh                : 36;
#else
	u64 thresh                : 36;
	u64 reserved_612_639      : 28;
#endif
	u64 reserved_640_703;		/* W10 */
	u64 reserved_704_767;		/* W11 */
	u64 reserved_768_831;		/* W12 */
	u64 reserved_832_895;		/* W13 */
	u64 reserved_896_959;		/* W14 */
	u64 reserved_960_1023;		/* W15 */
};

/* NIX admin queue completion status */
enum nix_aq_comp {
	NIX_AQ_COMP_NOTDONE        = 0x0,
	NIX_AQ_COMP_GOOD           = 0x1,
	NIX_AQ_COMP_SWERR          = 0x2,
	NIX_AQ_COMP_CTX_POISON     = 0x3,
	NIX_AQ_COMP_CTX_FAULT      = 0x4,
	NIX_AQ_COMP_LOCKERR        = 0x5,
	NIX_AQ_COMP_SQB_ALLOC_FAIL = 0x6,
};

/* NIX admin queue context types */
enum nix_aq_ctype {
	NIX_AQ_CTYPE_RQ   = 0x0,
	NIX_AQ_CTYPE_SQ   = 0x1,
	NIX_AQ_CTYPE_CQ   = 0x2,
	NIX_AQ_CTYPE_MCE  = 0x3,
	NIX_AQ_CTYPE_RSS  = 0x4,
	NIX_AQ_CTYPE_DYNO = 0x5,
};

/* NIX admin queue instruction opcodes */
enum nix_aq_instop {
	NIX_AQ_INSTOP_NOP    = 0x0,
	NIX_AQ_INSTOP_INIT   = 0x1,
	NIX_AQ_INSTOP_WRITE  = 0x2,
	NIX_AQ_INSTOP_READ   = 0x3,
	NIX_AQ_INSTOP_LOCK   = 0x4,
	NIX_AQ_INSTOP_UNLOCK = 0x5,
};

/* NIX admin queue instruction structure */
struct nix_aq_inst_s {
#if defined(__BIG_ENDIAN_BITFIELD)
	u64 doneint		: 1;	/* W0 */
	u64 reserved_44_62	: 19;
	u64 cindex		: 20;
	u64 reserved_15_23	: 9;
	u64 lf			: 7;
	u64 ctype		: 4;
	u64 op			: 4;
#else
	u64 op			: 4;
	u64 ctype		: 4;
	u64 lf			: 7;
	u64 reserved_15_23	: 9;
	u64 cindex		: 20;
	u64 reserved_44_62	: 19;
	u64 doneint		: 1;
#endif
	u64 res_addr;			/* W1 */
};

/* NIX admin queue result structure */
struct nix_aq_res_s {
#if defined(__BIG_ENDIAN_BITFIELD)
	u64 reserved_17_63	: 47;	/* W0 */
	u64 doneint		: 1;
	u64 compcode		: 8;
	u64 ctype		: 4;
	u64 op			: 4;
#else
	u64 op			: 4;
	u64 ctype		: 4;
	u64 compcode		: 8;
	u64 doneint		: 1;
	u64 reserved_17_63	: 47;
#endif
	u64 reserved_64_127;		/* W1 */
};

/* NIX Completion queue context structure */
struct nix_cq_ctx_s {
	u64 base;
#if defined(__BIG_ENDIAN_BITFIELD)	/* W1 */
	u64 wrptr		: 20;
	u64 avg_con		: 9;
	u64 cint_idx		: 7;
	u64 cq_err		: 1;
	u64 qint_idx		: 7;
	u64 rsvd_81_83		: 3;
	u64 bpid		: 9;
	u64 rsvd_69_71		: 3;
	u64 bp_ena		: 1;
	u64 rsvd_64_67		: 4;
#else
	u64 rsvd_64_67		: 4;
	u64 bp_ena		: 1;
	u64 rsvd_69_71		: 3;
	u64 bpid		: 9;
	u64 rsvd_81_83		: 3;
	u64 qint_idx		: 7;
	u64 cq_err		: 1;
	u64 cint_idx		: 7;
	u64 avg_con		: 9;
	u64 wrptr		: 20;
#endif
#if defined(__BIG_ENDIAN_BITFIELD)  /* W2 */
	u64 update_time		: 16;
	u64 avg_level		: 8;
	u64 head		: 20;
	u64 tail		: 20;
#else
	u64 tail		: 20;
	u64 head		: 20;
	u64 avg_level		: 8;
	u64 update_time		: 16;
#endif
#if defined(__BIG_ENDIAN_BITFIELD)  /* W3 */
	u64 cq_err_int_ena	: 8;
	u64 cq_err_int		: 8;
	u64 qsize		: 4;
	u64 rsvd_233_235	: 3;
	u64 caching		: 1;
	u64 substream		: 20;
	u64 rsvd_210_211	: 2;
	u64 ena			: 1;
	u64 drop_ena		: 1;
	u64 drop		: 8;
	u64 bp			: 8;
#else
	u64 bp			: 8;
	u64 drop		: 8;
	u64 drop_ena		: 1;
	u64 ena			: 1;
	u64 rsvd_210_211	: 2;
	u64 substream		: 20;
	u64 caching		: 1;
	u64 rsvd_233_235	: 3;
	u64 qsize		: 4;
	u64 cq_err_int		: 8;
	u64 cq_err_int_ena	: 8;
#endif
};

/* NIX Receive queue context structure */
struct nix_rq_ctx_s {
#if defined(__BIG_ENDIAN_BITFIELD)  /* W0 */
	u64 wqe_aura      : 20;
	u64 substream     : 20;
	u64 cq            : 20;
	u64 ena_wqwd      : 1;
	u64 ipsech_ena    : 1;
	u64 sso_ena       : 1;
	u64 ena           : 1;
#else
	u64 ena           : 1;
	u64 sso_ena       : 1;
	u64 ipsech_ena    : 1;
	u64 ena_wqwd      : 1;
	u64 cq            : 20;
	u64 substream     : 20;
	u64 wqe_aura      : 20;
#endif
#if defined(__BIG_ENDIAN_BITFIELD)  /* W1 */
	u64 rsvd_127_122  : 6;
	u64 lpb_drop_ena  : 1;
	u64 spb_drop_ena  : 1;
	u64 xqe_drop_ena  : 1;
	u64 wqe_caching   : 1;
	u64 pb_caching    : 2;
	u64 sso_tt        : 2;
	u64 sso_grp       : 10;
	u64 lpb_aura      : 20;
	u64 spb_aura      : 20;
#else
	u64 spb_aura      : 20;
	u64 lpb_aura      : 20;
	u64 sso_grp       : 10;
	u64 sso_tt        : 2;
	u64 pb_caching    : 2;
	u64 wqe_caching   : 1;
	u64 xqe_drop_ena  : 1;
	u64 spb_drop_ena  : 1;
	u64 lpb_drop_ena  : 1;
	u64 rsvd_127_122  : 6;
#endif
#if defined(__BIG_ENDIAN_BITFIELD)  /* W2 */
	u64 xqe_hdr_split : 1;
	u64 xqe_imm_copy  : 1;
	u64 rsvd_189_184  : 6;
	u64 xqe_imm_size  : 6;
	u64 later_skip    : 6;
	u64 rsvd_171      : 1;
	u64 first_skip    : 7;
	u64 lpb_sizem1    : 12;
	u64 spb_ena       : 1;
	u64 rsvd_150_148  : 3;
	u64 wqe_skip      : 2;
	u64 spb_sizem1    : 6;
	u64 rsvd_139_128  : 12;
#else
	u64 rsvd_139_128  : 12;
	u64 spb_sizem1    : 6;
	u64 wqe_skip      : 2;
	u64 rsvd_150_148  : 3;
	u64 spb_ena       : 1;
	u64 lpb_sizem1    : 12;
	u64 first_skip    : 7;
	u64 rsvd_171      : 1;
	u64 later_skip    : 6;
	u64 xqe_imm_size  : 6;
	u64 rsvd_189_184  : 6;
	u64 xqe_imm_copy  : 1;
	u64 xqe_hdr_split : 1;
#endif
#if defined(__BIG_ENDIAN_BITFIELD)  /* W3 */
	u64 spb_pool_pass : 8;
	u64 spb_pool_drop : 8;
	u64 spb_aura_pass : 8;
	u64 spb_aura_drop : 8;
	u64 wqe_pool_pass : 8;
	u64 wqe_pool_drop : 8;
	u64 xqe_pass      : 8;
	u64 xqe_drop      : 8;
#else
	u64 xqe_drop      : 8;
	u64 xqe_pass      : 8;
	u64 wqe_pool_drop : 8;
	u64 wqe_pool_pass : 8;
	u64 spb_aura_drop : 8;
	u64 spb_aura_pass : 8;
	u64 spb_pool_drop : 8;
	u64 spb_pool_pass : 8;
#endif
#if defined(__BIG_ENDIAN_BITFIELD)  /* W4 */
	u64 rsvd_319_315  : 5;
	u64 qint_idx      : 7;
	u64 rq_int_ena    : 8;
	u64 rq_int        : 8;
	u64 rsvd_291_288  : 4;
	u64 lpb_pool_pass : 8;
	u64 lpb_pool_drop : 8;
	u64 lpb_aura_pass : 8;
	u64 lpb_aura_drop : 8;
#else
	u64 lpb_aura_drop : 8;
	u64 lpb_aura_pass : 8;
	u64 lpb_pool_drop : 8;
	u64 lpb_pool_pass : 8;
	u64 rsvd_291_288  : 4;
	u64 rq_int        : 8;
	u64 rq_int_ena    : 8;
	u64 qint_idx      : 7;
	u64 rsvd_319_315  : 5;
#endif
#if defined(__BIG_ENDIAN_BITFIELD)  /* W5 */
	u64 rsvd_383_366  : 18;
	u64 flow_tagw     : 6;
	u64 bad_utag      : 8;
	u64 good_utag     : 8;
	u64 ltag          : 24;
#else
	u64 ltag          : 24;
	u64 good_utag     : 8;
	u64 bad_utag      : 8;
	u64 flow_tagw     : 6;
	u64 rsvd_383_366  : 18;
#endif
#if defined(__BIG_ENDIAN_BITFIELD)  /* W6 */
	u64 rsvd_447_432  : 16;
	u64 octs          : 48;
#else
	u64 octs          : 48;
	u64 rsvd_447_432  : 16;
#endif
#if defined(__BIG_ENDIAN_BITFIELD)  /* W7 */
	u64 rsvd_511_496  : 16;
	u64 pkts          : 48;
#else
	u64 pkts          : 48;
	u64 rsvd_511_496  : 16;
#endif
#if defined(__BIG_ENDIAN_BITFIELD)  /* W8 */
	u64 rsvd_575_560  : 16;
	u64 drop_octs     : 48;
#else
	u64 drop_octs     : 48;
	u64 rsvd_575_560  : 16;
#endif
#if defined(__BIG_ENDIAN_BITFIELD)	/* W9 */
	u64 rsvd_639_624  : 16;
	u64 drop_pkts     : 48;
#else
	u64 drop_pkts     : 48;
	u64 rsvd_639_624  : 16;
#endif
#if defined(__BIG_ENDIAN_BITFIELD)	/* W10 */
	u64 rsvd_703_688  : 16;
	u64 re_pkts       : 48;
#else
	u64 re_pkts       : 48;
	u64 rsvd_703_688  : 16;
#endif
	u64 rsvd_767_704;		/* W11 */
	u64 rsvd_831_768;		/* W12 */
	u64 rsvd_895_832;		/* W13 */
	u64 rsvd_959_896;		/* W14 */
	u64 rsvd_1023_960;		/* W15 */
};

/* NIX sqe sizes */
enum nix_maxsqesz {
	NIX_MAXSQESZ_W16 = 0x0,
	NIX_MAXSQESZ_W8  = 0x1,
};

/* NIX SQB caching type */
enum nix_stype {
	NIX_STYPE_STF = 0x0,
	NIX_STYPE_STT = 0x1,
	NIX_STYPE_STP = 0x2,
};

/* NIX Send queue context structure */
struct nix_sq_ctx_s {
#if defined(__BIG_ENDIAN_BITFIELD)  /* W0 */
	u64 sqe_way_mask          : 16;
	u64 cq                    : 20;
	u64 sdp_mcast             : 1;
	u64 substream             : 20;
	u64 qint_idx              : 6;
	u64 ena                   : 1;
#else
	u64 ena                   : 1;
	u64 qint_idx              : 6;
	u64 substream             : 20;
	u64 sdp_mcast             : 1;
	u64 cq                    : 20;
	u64 sqe_way_mask          : 16;
#endif
#if defined(__BIG_ENDIAN_BITFIELD)  /* W1 */
	u64 sqb_count             : 16;
	u64 default_chan          : 12;
	u64 smq_rr_quantum        : 24;
	u64 sso_ena               : 1;
	u64 xoff                  : 1;
	u64 cq_ena                : 1;
	u64 smq                   : 9;
#else
	u64 smq                   : 9;
	u64 cq_ena                : 1;
	u64 xoff                  : 1;
	u64 sso_ena               : 1;
	u64 smq_rr_quantum        : 24;
	u64 default_chan          : 12;
	u64 sqb_count             : 16;
#endif
#if defined(__BIG_ENDIAN_BITFIELD)  /* W2 */
	u64 rsvd_191              : 1;
	u64 sqe_stype             : 2;
	u64 sq_int_ena            : 8;
	u64 sq_int                : 8;
	u64 sqb_aura              : 20;
	u64 smq_rr_count          : 25;
#else
	u64 smq_rr_count          : 25;
	u64 sqb_aura              : 20;
	u64 sq_int                : 8;
	u64 sq_int_ena            : 8;
	u64 sqe_stype             : 2;
	u64 rsvd_191              : 1;
#endif
#if defined(__BIG_ENDIAN_BITFIELD)  /* W3 */
	u64 rsvd_255_253          : 3;
	u64 smq_next_sq_vld       : 1;
	u64 smq_pend              : 1;
	u64 smenq_next_sqb_vld    : 1;
	u64 head_offset           : 6;
	u64 smenq_offset          : 6;
	u64 tail_offset           : 6;
	u64 smq_lso_segnum        : 8;
	u64 smq_next_sq           : 20;
	u64 mnq_dis               : 1;
	u64 lmt_dis               : 1;
	u64 cq_limit              : 8;
	u64 max_sqe_size          : 2;
#else
	u64 max_sqe_size          : 2;
	u64 cq_limit              : 8;
	u64 lmt_dis               : 1;
	u64 mnq_dis               : 1;
	u64 smq_next_sq           : 20;
	u64 smq_lso_segnum        : 8;
	u64 tail_offset           : 6;
	u64 smenq_offset          : 6;
	u64 head_offset           : 6;
	u64 smenq_next_sqb_vld    : 1;
	u64 smq_pend              : 1;
	u64 smq_next_sq_vld       : 1;
	u64 rsvd_255_253          : 3;
#endif
	u64 next_sqb              : 64;/* W4 */
	u64 tail_sqb              : 64;/* W5 */
	u64 smenq_sqb             : 64;/* W6 */
	u64 smenq_next_sqb        : 64;/* W7 */
	u64 head_sqb              : 64;/* W8 */
#if defined(__BIG_ENDIAN_BITFIELD)  /* W9 */
	u64 rsvd_639_630          : 10;
	u64 vfi_lso_vld           : 1;
	u64 vfi_lso_vlan1_ins_ena : 1;
	u64 vfi_lso_vlan0_ins_ena : 1;
	u64 vfi_lso_mps           : 14;
	u64 vfi_lso_sb            : 8;
	u64 vfi_lso_sizem1        : 3;
	u64 vfi_lso_total         : 18;
	u64 rsvd_583_576          : 8;
#else
	u64 rsvd_583_576          : 8;
	u64 vfi_lso_total         : 18;
	u64 vfi_lso_sizem1        : 3;
	u64 vfi_lso_sb            : 8;
	u64 vfi_lso_mps           : 14;
	u64 vfi_lso_vlan0_ins_ena : 1;
	u64 vfi_lso_vlan1_ins_ena : 1;
	u64 vfi_lso_vld           : 1;
	u64 rsvd_639_630          : 10;
#endif
#if defined(__BIG_ENDIAN_BITFIELD) /* W10 */
	u64 rsvd_703_658          : 46;
	u64 scm_lso_rem           : 18;
#else
	u64 scm_lso_rem           : 18;
	u64 rsvd_703_658          : 46;
#endif
#if defined(__BIG_ENDIAN_BITFIELD) /* W11 */
	u64 rsvd_767_752          : 16;
	u64 octs                  : 48;
#else
	u64 octs                  : 48;
	u64 rsvd_767_752          : 16;
#endif
#if defined(__BIG_ENDIAN_BITFIELD) /* W12 */
	u64 rsvd_831_816          : 16;
	u64 pkts                  : 48;
#else
	u64 pkts                  : 48;
	u64 rsvd_831_816          : 16;
#endif
	u64 rsvd_895_832          : 64;/* W13 */
#if defined(__BIG_ENDIAN_BITFIELD) /* W14 */
	u64 rsvd_959_944          : 16;
	u64 dropped_octs          : 48;
#else
	u64 dropped_octs          : 48;
	u64 rsvd_959_944          : 16;
#endif
#if defined(__BIG_ENDIAN_BITFIELD) /* W15 */
	u64 rsvd_1023_1008        : 16;
	u64 dropped_pkts          : 48;
#else
	u64 dropped_pkts          : 48;
	u64 rsvd_1023_1008        : 16;
#endif
};

/* NIX Receive side scaling entry structure*/
struct nix_rsse_s {
#if defined(__BIG_ENDIAN_BITFIELD)
	uint32_t reserved_20_31		: 12;
	uint32_t rq			: 20;
#else
	uint32_t rq			: 20;
	uint32_t reserved_20_31		: 12;

#endif
};

/* NIX receive multicast/mirror entry structure */
struct nix_rx_mce_s {
#if defined(__BIG_ENDIAN_BITFIELD)  /* W0 */
	uint64_t next       : 16;
	uint64_t pf_func    : 16;
	uint64_t rsvd_31_24 : 8;
	uint64_t index      : 20;
	uint64_t eol        : 1;
	uint64_t rsvd_2     : 1;
	uint64_t op         : 2;
#else
	uint64_t op         : 2;
	uint64_t rsvd_2     : 1;
	uint64_t eol        : 1;
	uint64_t index      : 20;
	uint64_t rsvd_31_24 : 8;
	uint64_t pf_func    : 16;
	uint64_t next       : 16;
#endif
};

enum nix_lsoalg {
	NIX_LSOALG_NOP,
	NIX_LSOALG_ADD_SEGNUM,
	NIX_LSOALG_ADD_PAYLEN,
	NIX_LSOALG_ADD_OFFSET,
	NIX_LSOALG_TCP_FLAGS,
};

enum nix_txlayer {
	NIX_TXLAYER_OL3,
	NIX_TXLAYER_OL4,
	NIX_TXLAYER_IL3,
	NIX_TXLAYER_IL4,
};

struct nix_lso_format {
#if defined(__BIG_ENDIAN_BITFIELD)
	u64 rsvd_19_63		: 45;
	u64 alg			: 3;
	u64 rsvd_14_15		: 2;
	u64 sizem1		: 2;
	u64 rsvd_10_11		: 2;
	u64 layer		: 2;
	u64 offset		: 8;
#else
	u64 offset		: 8;
	u64 layer		: 2;
	u64 rsvd_10_11		: 2;
	u64 sizem1		: 2;
	u64 rsvd_14_15		: 2;
	u64 alg			: 3;
	u64 rsvd_19_63		: 45;
#endif
};

struct nix_rx_flowkey_alg {
#if defined(__BIG_ENDIAN_BITFIELD)
	u64 reserved_35_63	:29;
	u64 ltype_match		:4;
	u64 ltype_mask		:4;
	u64 sel_chan		:1;
	u64 ena			:1;
	u64 reserved_24_24	:1;
	u64 lid			:3;
	u64 bytesm1		:5;
	u64 hdr_offset		:8;
	u64 fn_mask		:1;
	u64 ln_mask		:1;
	u64 key_offset		:6;
#else
	u64 key_offset		:6;
	u64 ln_mask		:1;
	u64 fn_mask		:1;
	u64 hdr_offset		:8;
	u64 bytesm1		:5;
	u64 lid			:3;
	u64 reserved_24_24	:1;
	u64 ena			:1;
	u64 sel_chan		:1;
	u64 ltype_mask		:4;
	u64 ltype_match		:4;
	u64 reserved_35_63	:29;
#endif
};

/* NIX VTAG size */
enum nix_vtag_size {
	VTAGSIZE_T4   = 0x0,
	VTAGSIZE_T8   = 0x1,
};
#endif /* RVU_STRUCT_H */