1 /* SPDX-License-Identifier: GPL-2.0
3 * Copyright (C) 2020 Marvell International Ltd.
5 * https://spdx.org/licenses
13 * Configuration and status register (CSR) address and type definitions for
16 * This file is auto generated. Do not edit.
21 * Enumeration npc_errlev_e
23 * NPC Error Level Enumeration Enumerates the lowest protocol layer
24 * containing an error.
26 #define NPC_ERRLEV_E_LA (1)
27 #define NPC_ERRLEV_E_LB (2)
28 #define NPC_ERRLEV_E_LC (3)
29 #define NPC_ERRLEV_E_LD (4)
30 #define NPC_ERRLEV_E_LE (5)
31 #define NPC_ERRLEV_E_LF (6)
32 #define NPC_ERRLEV_E_LG (7)
33 #define NPC_ERRLEV_E_LH (8)
34 #define NPC_ERRLEV_E_NIX (0xf)
35 #define NPC_ERRLEV_E_RX(a) (0 + (a))
36 #define NPC_ERRLEV_E_RE (0)
39 * Enumeration npc_intf_e
41 * NPC Interface Enumeration Enumerates the NPC interfaces.
43 #define NPC_INTF_E_NIXX_RX(a) (0 + 2 * (a))
44 #define NPC_INTF_E_NIXX_TX(a) (1 + 2 * (a))
47 * Enumeration npc_lid_e
49 * NPC Layer ID Enumeration Enumerates layers parsed by NPC.
51 #define NPC_LID_E_LA (0)
52 #define NPC_LID_E_LB (1)
53 #define NPC_LID_E_LC (2)
54 #define NPC_LID_E_LD (3)
55 #define NPC_LID_E_LE (4)
56 #define NPC_LID_E_LF (5)
57 #define NPC_LID_E_LG (6)
58 #define NPC_LID_E_LH (7)
61 * Enumeration npc_lkupop_e
63 * NPC Lookup Operation Enumeration Enumerates the lookup operation for
64 * NPC_AF_LKUP_CTL[OP].
66 #define NPC_LKUPOP_E_KEY (1)
67 #define NPC_LKUPOP_E_PKT (0)
70 * Enumeration npc_mcamkeyw_e
72 * NPC MCAM Search Key Width Enumeration
74 #define NPC_MCAMKEYW_E_X1 (0)
75 #define NPC_MCAMKEYW_E_X2 (1)
76 #define NPC_MCAMKEYW_E_X4 (2)
79 * Structure npc_layer_info_s
81 * NPC Layer Parse Information Structure This structure specifies the
82 * format of NPC_RESULT_S[LA,LB,...,LH].
84 union npc_layer_info_s {
86 struct npc_layer_info_s_s {
90 u32 reserved_20_31 : 12;
92 /* struct npc_layer_info_s_s cn; */
96 * Structure npc_layer_kex_s
98 * NPC Layer MCAM Search Key Extract Structure This structure specifies
99 * the format of each of the NPC_PARSE_KEX_S[LA,LB,...,LH] fields. It
100 * contains the subset of NPC_LAYER_INFO_S fields that can be included in
101 * the MCAM search key. See NPC_PARSE_KEX_S and NPC_AF_INTF()_KEX_CFG.
103 union npc_layer_kex_s {
105 struct npc_layer_kex_s_s {
108 u32 reserved_12_31 : 20;
110 /* struct npc_layer_kex_s_s cn; */
114 * Structure npc_mcam_key_x1_s
116 * NPC MCAM Search Key X1 Structure This structure specifies the MCAM
117 * search key format used by an interface when
118 * NPC_AF_INTF()_KEX_CFG[KEYW] = NPC_MCAMKEYW_E::X1.
120 union npc_mcam_key_x1_s {
122 struct npc_mcam_key_x1_s_s {
124 u64 reserved_2_63 : 62;
127 u64 reserved_176_191 : 16;
129 /* struct npc_mcam_key_x1_s_s cn; */
133 * Structure npc_mcam_key_x2_s
135 * NPC MCAM Search Key X2 Structure This structure specifies the MCAM
136 * search key format used by an interface when
137 * NPC_AF_INTF()_KEX_CFG[KEYW] = NPC_MCAMKEYW_E::X2.
139 union npc_mcam_key_x2_s {
141 struct npc_mcam_key_x2_s_s {
143 u64 reserved_2_63 : 62;
148 u64 reserved_288_319 : 32;
150 /* struct npc_mcam_key_x2_s_s cn; */
154 * Structure npc_mcam_key_x4_s
156 * NPC MCAM Search Key X4 Structure This structure specifies the MCAM
157 * search key format used by an interface when
158 * NPC_AF_INTF()_KEX_CFG[KEYW] = NPC_MCAMKEYW_E::X4.
160 union npc_mcam_key_x4_s {
162 struct npc_mcam_key_x4_s_s {
164 u64 reserved_2_63 : 62;
173 /* struct npc_mcam_key_x4_s_s cn; */
177 * Structure npc_parse_kex_s
179 * NPC Parse Key Extract Structure This structure contains the subset of
180 * NPC_RESULT_S fields that can be included in the MCAM search key. See
181 * NPC_AF_INTF()_KEX_CFG.
183 union npc_parse_kex_s {
185 struct npc_parse_kex_s_s {
201 u64 reserved_124_127 : 4;
203 /* struct npc_parse_kex_s_s cn; */
207 * Structure npc_result_s
209 * NPC Result Structure This structure contains a packet's parse and flow
210 * identification information.
214 struct npc_result_s_s {
225 u64 reserved_44_63 : 20;
227 u64 vtag_action : 64;
231 u64 reserved_252_255 : 4;
235 u64 reserved_316_319 : 4;
238 u64 reserved_360_383 : 24;
240 /* struct npc_result_s_s cn; */
244 * Register (RVU_PF_BAR0) npc_af_active_pc
246 * NPC Interrupt-Timer Configuration Register
248 union npc_af_active_pc {
250 struct npc_af_active_pc_s {
253 /* struct npc_af_active_pc_s cn; */
256 static inline u64 NPC_AF_ACTIVE_PC(void)
257 __attribute__ ((pure, always_inline));
258 static inline u64 NPC_AF_ACTIVE_PC(void)
264 * Register (RVU_PF_BAR0) npc_af_blk_rst
266 * NPC AF Block Reset Register
268 union npc_af_blk_rst {
270 struct npc_af_blk_rst_s {
272 u64 reserved_1_62 : 62;
275 /* struct npc_af_blk_rst_s cn; */
278 static inline u64 NPC_AF_BLK_RST(void)
279 __attribute__ ((pure, always_inline));
280 static inline u64 NPC_AF_BLK_RST(void)
286 * Register (RVU_PF_BAR0) npc_af_cfg
288 * NPC AF General Configuration Register
292 struct npc_af_cfg_s {
293 u64 reserved_0_1 : 2;
295 u64 force_intf_clk_en : 1;
296 u64 reserved_4_63 : 60;
298 /* struct npc_af_cfg_s cn; */
301 static inline u64 NPC_AF_CFG(void)
302 __attribute__ ((pure, always_inline));
303 static inline u64 NPC_AF_CFG(void)
309 * Register (RVU_PF_BAR0) npc_af_const
311 * NPC AF Constants Register This register contains constants for
312 * software discovery.
316 struct npc_af_const_s {
320 u64 reserved_13_15 : 3;
321 u64 mcam_bank_width : 10;
322 u64 reserved_26_27 : 2;
323 u64 mcam_bank_depth : 16;
325 u64 match_stats : 16;
327 /* struct npc_af_const_s cn; */
330 static inline u64 NPC_AF_CONST(void)
331 __attribute__ ((pure, always_inline));
332 static inline u64 NPC_AF_CONST(void)
338 * Register (RVU_PF_BAR0) npc_af_const1
340 * NPC AF Constants 1 Register This register contains constants for
341 * software discovery.
343 union npc_af_const1 {
345 struct npc_af_const1_s {
346 u64 kpu_entries : 12;
349 u64 reserved_36_63 : 28;
351 /* struct npc_af_const1_s cn; */
354 static inline u64 NPC_AF_CONST1(void)
355 __attribute__ ((pure, always_inline));
356 static inline u64 NPC_AF_CONST1(void)
362 * Register (RVU_PF_BAR0) npc_af_cpi#_cfg
364 * NPC AF Channel Parse Index Table Registers
366 union npc_af_cpix_cfg {
368 struct npc_af_cpix_cfg_s {
370 u64 reserved_4_63 : 60;
372 /* struct npc_af_cpix_cfg_s cn; */
375 static inline u64 NPC_AF_CPIX_CFG(u64 a)
376 __attribute__ ((pure, always_inline));
377 static inline u64 NPC_AF_CPIX_CFG(u64 a)
379 return 0x200000 + 8 * a;
383 * Register (RVU_PF_BAR0) npc_af_dbg_ctl
385 * NPC AF Debug Control Register This register controls the capture of
386 * debug information in NPC_AF_KPU()_DBG, NPC_AF_MCAM_DBG,
387 * NPC_AF_DBG_DATA() and NPC_AF_DBG_RESULT().
389 union npc_af_dbg_ctl {
391 struct npc_af_dbg_ctl_s {
395 u64 reserved_6_63 : 58;
397 /* struct npc_af_dbg_ctl_s cn; */
400 static inline u64 NPC_AF_DBG_CTL(void)
401 __attribute__ ((pure, always_inline));
402 static inline u64 NPC_AF_DBG_CTL(void)
408 * Register (RVU_PF_BAR0) npc_af_dbg_data#
410 * NPC AF Debug Data Registers These registers contain the packet header
411 * data of the last packet/lookup whose debug information is captured by
412 * NPC_AF_DBG_CTL[INTF_DBG,LKUP_DBG].
414 union npc_af_dbg_datax {
416 struct npc_af_dbg_datax_s {
419 /* struct npc_af_dbg_datax_s cn; */
422 static inline u64 NPC_AF_DBG_DATAX(u64 a)
423 __attribute__ ((pure, always_inline));
424 static inline u64 NPC_AF_DBG_DATAX(u64 a)
426 return 0x3001400 + 0x10 * a;
430 * Register (RVU_PF_BAR0) npc_af_dbg_result#
432 * NPC AF Debug Result Registers These registers contain the result data
433 * of the last packet/lookup whose debug information is captured by
434 * NPC_AF_DBG_CTL[INTF_DBG,LKUP_DBG]. Internal: FIXME - add note about
435 * coherency of data in continuous packet capture mode.
437 union npc_af_dbg_resultx {
439 struct npc_af_dbg_resultx_s {
442 /* struct npc_af_dbg_resultx_s cn; */
445 static inline u64 NPC_AF_DBG_RESULTX(u64 a)
446 __attribute__ ((pure, always_inline));
447 static inline u64 NPC_AF_DBG_RESULTX(u64 a)
449 return 0x3001800 + 0x10 * a;
453 * Register (RVU_PF_BAR0) npc_af_dbg_status
455 * NPC AF Debug Status Register
457 union npc_af_dbg_status {
459 struct npc_af_dbg_status_s {
461 u64 reserved_1_63 : 63;
463 /* struct npc_af_dbg_status_s cn; */
466 static inline u64 NPC_AF_DBG_STATUS(void)
467 __attribute__ ((pure, always_inline));
468 static inline u64 NPC_AF_DBG_STATUS(void)
474 * Register (RVU_PF_BAR0) npc_af_dv_fc_scratch
476 * INTERNAL: NPC AF Scratch Register Internal: This register is for
477 * internal DV purpose.
479 union npc_af_dv_fc_scratch {
481 struct npc_af_dv_fc_scratch_s {
484 /* struct npc_af_dv_fc_scratch_s cn; */
487 static inline u64 NPC_AF_DV_FC_SCRATCH(void)
488 __attribute__ ((pure, always_inline));
489 static inline u64 NPC_AF_DV_FC_SCRATCH(void)
495 * Register (RVU_PF_BAR0) npc_af_eco0
497 * INTERNAL: ECO 0 Register
501 struct npc_af_eco0_s {
503 u64 reserved_32_63 : 32;
505 /* struct npc_af_eco0_s cn; */
508 static inline u64 NPC_AF_ECO0(void)
509 __attribute__ ((pure, always_inline));
510 static inline u64 NPC_AF_ECO0(void)
516 * Register (RVU_PF_BAR0) npc_af_ikpu_err_ctl
518 * NPC AF Initial KPU Error Control Registers Similar to
519 * NPC_AF_KPU()_ERR_CTL, but specifies values captured in
520 * NPC_RESULT_S[ERRLEV,ERRCODE] for errors detected by the PKIND-based
521 * initial actions from NPC_AF_PKIND()_ACTION0 and
522 * NPC_AF_PKIND()_ACTION1. [DP_OFFSET_ERRCODE] from this register is
525 union npc_af_ikpu_err_ctl {
527 struct npc_af_ikpu_err_ctl_s {
529 u64 dp_offset_errcode : 8;
530 u64 ptr_advance_errcode : 8;
531 u64 var_len_offset_errcode : 8;
532 u64 reserved_28_63 : 36;
534 /* struct npc_af_ikpu_err_ctl_s cn; */
537 static inline u64 NPC_AF_IKPU_ERR_CTL(void)
538 __attribute__ ((pure, always_inline));
539 static inline u64 NPC_AF_IKPU_ERR_CTL(void)
545 * Register (RVU_PF_BAR0) npc_af_intf#_kex_cfg
547 * NPC AF Interface Key Extract Configuration Registers
549 union npc_af_intfx_kex_cfg {
551 struct npc_af_intfx_kex_cfg_s {
552 u64 parse_nibble_ena : 31;
555 u64 reserved_35_63 : 29;
557 /* struct npc_af_intfx_kex_cfg_s cn; */
560 static inline u64 NPC_AF_INTFX_KEX_CFG(u64 a)
561 __attribute__ ((pure, always_inline));
562 static inline u64 NPC_AF_INTFX_KEX_CFG(u64 a)
564 return 0x1010 + 0x100 * a;
568 * Register (RVU_PF_BAR0) npc_af_intf#_ldata#_flags#_cfg
570 * NPC AF Interface Layer Data Flags Configuration Registers These
571 * registers control the extraction of layer data (LDATA) into the MCAM
572 * search key for each interface based on the FLAGS\<3:0\> bits of two
573 * layers selected by NPC_AF_KEX_LDATA()_FLAGS_CFG.
575 union npc_af_intfx_ldatax_flagsx_cfg {
577 struct npc_af_intfx_ldatax_flagsx_cfg_s {
583 u64 reserved_20_63 : 44;
585 /* struct npc_af_intfx_ldatax_flagsx_cfg_s cn; */
588 static inline u64 NPC_AF_INTFX_LDATAX_FLAGSX_CFG(u64 a, u64 b, u64 c)
589 __attribute__ ((pure, always_inline));
590 static inline u64 NPC_AF_INTFX_LDATAX_FLAGSX_CFG(u64 a, u64 b, u64 c)
592 return 0x980000 + 0x10000 * a + 0x1000 * b + 8 * c;
596 * Register (RVU_PF_BAR0) npc_af_intf#_lid#_lt#_ld#_cfg
598 * NPC AF Interface Layer Data Extract Configuration Registers These
599 * registers control the extraction of layer data (LDATA) into the MCAM
600 * search key for each interface. Up to two LDATA fields can be extracted
601 * per layer (LID(0..7) indexed by NPC_LID_E), with up to 16 bytes per
602 * LDATA field. For each layer, the corresponding NPC_LAYER_INFO_S[LTYPE]
603 * value in NPC_RESULT_S is used as the LTYPE(0..15) index and select the
604 * associated LDATA(0..1) registers. NPC_LAYER_INFO_S[LTYPE]=0x0 means
605 * the corresponding layer not parsed (invalid), so software should keep
606 * NPC_AF_INTF()_LID()_LT(0)_LD()_CFG[ENA] clear to disable extraction
607 * when LTYPE is zero.
609 union npc_af_intfx_lidx_ltx_ldx_cfg {
611 struct npc_af_intfx_lidx_ltx_ldx_cfg_s {
617 u64 reserved_20_63 : 44;
619 /* struct npc_af_intfx_lidx_ltx_ldx_cfg_s cn; */
622 static inline u64 NPC_AF_INTFX_LIDX_LTX_LDX_CFG(u64 a, u64 b, u64 c, u64 d)
623 __attribute__ ((pure, always_inline));
624 static inline u64 NPC_AF_INTFX_LIDX_LTX_LDX_CFG(u64 a, u64 b, u64 c, u64 d)
626 return 0x900000 + 0x10000 * a + 0x1000 * b + 0x20 * c + 8 * d;
630 * Register (RVU_PF_BAR0) npc_af_intf#_miss_act
632 * NPC AF Interface MCAM Miss Action Data Registers When a combination of
633 * NPC_AF_MCAME()_BANK()_CAM()_* and NPC_AF_MCAME()_BANK()_CFG[ENA]
634 * yields an MCAM miss for a packet, this register specifies the packet's
635 * match action captured in NPC_RESULT_S[ACTION].
637 union npc_af_intfx_miss_act {
639 struct npc_af_intfx_miss_act_s {
642 /* struct npc_af_intfx_miss_act_s cn; */
645 static inline u64 NPC_AF_INTFX_MISS_ACT(u64 a)
646 __attribute__ ((pure, always_inline));
647 static inline u64 NPC_AF_INTFX_MISS_ACT(u64 a)
649 return 0x1a00000 + 0x10 * a;
653 * Register (RVU_PF_BAR0) npc_af_intf#_miss_stat_act
655 * NPC AF Interface MCAM Miss Stat Action Data Registers Used to
656 * optionally increment a NPC_AF_MATCH_STAT() counter when a packet
657 * misses an MCAM entry.
659 union npc_af_intfx_miss_stat_act {
661 struct npc_af_intfx_miss_stat_act_s {
664 u64 reserved_10_63 : 54;
666 /* struct npc_af_intfx_miss_stat_act_s cn; */
669 static inline u64 NPC_AF_INTFX_MISS_STAT_ACT(u64 a)
670 __attribute__ ((pure, always_inline));
671 static inline u64 NPC_AF_INTFX_MISS_STAT_ACT(u64 a)
673 return 0x1880040 + 8 * a;
677 * Register (RVU_PF_BAR0) npc_af_intf#_miss_tag_act
679 * NPC AF Interface MCAM Miss VTag Action Data Registers When a
680 * combination of NPC_AF_MCAME()_BANK()_CAM()_* and
681 * NPC_AF_MCAME()_BANK()_CFG[ENA] yields an MCAM miss for a packet, this
682 * register specifies the packet's match Vtag action captured in
683 * NPC_RESULT_S[VTAG_ACTION].
685 union npc_af_intfx_miss_tag_act {
687 struct npc_af_intfx_miss_tag_act_s {
688 u64 vtag_action : 64;
690 /* struct npc_af_intfx_miss_tag_act_s cn; */
693 static inline u64 NPC_AF_INTFX_MISS_TAG_ACT(u64 a)
694 __attribute__ ((pure, always_inline));
695 static inline u64 NPC_AF_INTFX_MISS_TAG_ACT(u64 a)
697 return 0x1b00008 + 0x10 * a;
701 * Register (RVU_PF_BAR0) npc_af_intf#_stat
703 * NPC AF Interface Statistics Registers Statistics per interface. Index
704 * enumerated by NPC_INTF_E.
706 union npc_af_intfx_stat {
708 struct npc_af_intfx_stat_s {
710 u64 reserved_48_63 : 16;
712 /* struct npc_af_intfx_stat_s cn; */
715 static inline u64 NPC_AF_INTFX_STAT(u64 a)
716 __attribute__ ((pure, always_inline));
717 static inline u64 NPC_AF_INTFX_STAT(u64 a)
719 return 0x2000800 + 0x10 * a;
723 * Register (RVU_PF_BAR0) npc_af_kcam_scrub_ctl
725 * NPC AF KCAM Scrub Control Register
727 union npc_af_kcam_scrub_ctl {
729 struct npc_af_kcam_scrub_ctl_s {
731 u64 reserved_1_7 : 7;
733 u64 reserved_9_15 : 7;
735 u64 reserved_20_63 : 44;
737 /* struct npc_af_kcam_scrub_ctl_s cn; */
740 static inline u64 NPC_AF_KCAM_SCRUB_CTL(void)
741 __attribute__ ((pure, always_inline));
742 static inline u64 NPC_AF_KCAM_SCRUB_CTL(void)
748 * Register (RVU_PF_BAR0) npc_af_kex_ldata#_flags_cfg
750 * NPC AF Key Extract Layer Data Flags Configuration Register
752 union npc_af_kex_ldatax_flags_cfg {
754 struct npc_af_kex_ldatax_flags_cfg_s {
756 u64 reserved_3_63 : 61;
758 /* struct npc_af_kex_ldatax_flags_cfg_s cn; */
761 static inline u64 NPC_AF_KEX_LDATAX_FLAGS_CFG(u64 a)
762 __attribute__ ((pure, always_inline));
763 static inline u64 NPC_AF_KEX_LDATAX_FLAGS_CFG(u64 a)
765 return 0x800 + 8 * a;
769 * Register (RVU_PF_BAR0) npc_af_kpu#_cfg
771 * NPC AF KPU Configuration Registers
773 union npc_af_kpux_cfg {
775 struct npc_af_kpux_cfg_s {
777 u64 reserved_1_63 : 63;
779 /* struct npc_af_kpux_cfg_s cn; */
782 static inline u64 NPC_AF_KPUX_CFG(u64 a)
783 __attribute__ ((pure, always_inline));
784 static inline u64 NPC_AF_KPUX_CFG(u64 a)
786 return 0x500 + 8 * a;
790 * Register (RVU_PF_BAR0) npc_af_kpu#_dbg
792 * NPC AF KPU Debug Registers This register contains information for the
793 * last packet/lookup for which debug is enabled by
794 * NPC_AF_DBG_CTL[INTF_DBG,LKUP_DBG]. The register contents are undefined
795 * when debug information is captured for a software key lookup
796 * (NPC_AF_LKUP_CTL[OP] = NPC_LKUPOP_E::KEY).
798 union npc_af_kpux_dbg {
800 struct npc_af_kpux_dbg_s {
803 u64 reserved_9_63 : 55;
805 /* struct npc_af_kpux_dbg_s cn; */
808 static inline u64 NPC_AF_KPUX_DBG(u64 a)
809 __attribute__ ((pure, always_inline));
810 static inline u64 NPC_AF_KPUX_DBG(u64 a)
812 return 0x3000020 + 0x100 * a;
816 * Register (RVU_PF_BAR0) npc_af_kpu#_entry#_action0
818 * NPC AF KPU Entry Action Data 0 Registers When a KPU's search data
819 * matches a KPU CAM entry in NPC_AF_KPU()_ENTRY()_CAM(), the
820 * corresponding entry action in NPC_AF_KPU()_ENTRY()_ACTION0 and
821 * NPC_AF_KPU()_ENTRY()_ACTION1 specifies the next state and operations
822 * to perform before exiting the KPU.
824 union npc_af_kpux_entryx_action0 {
826 struct npc_af_kpux_entryx_action0_s {
827 u64 var_len_shift : 3;
828 u64 var_len_right : 1;
829 u64 var_len_mask : 8;
830 u64 var_len_offset : 8;
832 u64 capture_flags : 8;
833 u64 capture_ltype : 4;
840 u64 reserved_57_63 : 7;
842 /* struct npc_af_kpux_entryx_action0_s cn; */
845 static inline u64 NPC_AF_KPUX_ENTRYX_ACTION0(u64 a, u64 b)
846 __attribute__ ((pure, always_inline));
847 static inline u64 NPC_AF_KPUX_ENTRYX_ACTION0(u64 a, u64 b)
849 return 0x100020 + 0x4000 * a + 0x40 * b;
853 * Register (RVU_PF_BAR0) npc_af_kpu#_entry#_action1
855 * NPC AF KPU Entry Action Data 0 Registers See
856 * NPC_AF_KPU()_ENTRY()_ACTION0.
858 union npc_af_kpux_entryx_action1 {
860 struct npc_af_kpux_entryx_action1_s {
866 u64 reserved_36_63 : 28;
868 /* struct npc_af_kpux_entryx_action1_s cn; */
871 static inline u64 NPC_AF_KPUX_ENTRYX_ACTION1(u64 a, u64 b)
872 __attribute__ ((pure, always_inline));
873 static inline u64 NPC_AF_KPUX_ENTRYX_ACTION1(u64 a, u64 b)
875 return 0x100028 + 0x4000 * a + 0x40 * b;
879 * Register (RVU_PF_BAR0) npc_af_kpu#_entry#_cam#
881 * NPC AF KPU Entry CAM Registers KPU comparison ternary data. The field
882 * values in NPC_AF_KPU()_ENTRY()_CAM() are ternary, where each data bit
883 * of the search key matches as follows: _ [CAM(1)]\<n\>=0,
884 * [CAM(0)]\<n\>=0: Always match; search key data\<n\> don't care. _
885 * [CAM(1)]\<n\>=0, [CAM(0)]\<n\>=1: Match when search key data\<n\> ==
886 * 0. _ [CAM(1)]\<n\>=1, [CAM(0)]\<n\>=0: Match when search key data\<n\>
887 * == 1. _ [CAM(1)]\<n\>=1, [CAM(0)]\<n\>=1: Reserved. The reserved
888 * combination is not allowed. Hardware suppresses any write to CAM(0) or
889 * CAM(1) that would result in the reserved combination for any CAM bit.
890 * The reset value for all non-reserved fields is all zeros for CAM(1)
891 * and all ones for CAM(0), matching a search key of all zeros. Software
892 * must program a default entry for each KPU, e.g. by programming each
893 * KPU's last entry {b} (NPC_AF_KPU()_ENTRY({b})_CAM()) to always match
896 union npc_af_kpux_entryx_camx {
898 struct npc_af_kpux_entryx_camx_s {
903 u64 reserved_56_63 : 8;
905 /* struct npc_af_kpux_entryx_camx_s cn; */
908 static inline u64 NPC_AF_KPUX_ENTRYX_CAMX(u64 a, u64 b, u64 c)
909 __attribute__ ((pure, always_inline));
910 static inline u64 NPC_AF_KPUX_ENTRYX_CAMX(u64 a, u64 b, u64 c)
912 return 0x100000 + 0x4000 * a + 0x40 * b + 8 * c;
916 * Register (RVU_PF_BAR0) npc_af_kpu#_entry_dis#
918 * NPC AF KPU Entry Disable Registers See NPC_AF_KPU()_ENTRY()_ACTION0.
920 union npc_af_kpux_entry_disx {
922 struct npc_af_kpux_entry_disx_s {
925 /* struct npc_af_kpux_entry_disx_s cn; */
928 static inline u64 NPC_AF_KPUX_ENTRY_DISX(u64 a, u64 b)
929 __attribute__ ((pure, always_inline));
930 static inline u64 NPC_AF_KPUX_ENTRY_DISX(u64 a, u64 b)
932 return 0x180000 + 0x40 * a + 8 * b;
936 * Register (RVU_PF_BAR0) npc_af_kpu#_err_ctl
938 * NPC AF KPU Error Control Registers This register specifies values
939 * captured in NPC_RESULT_S[ERRLEV,ERRCODE] when errors are detected by a
942 union npc_af_kpux_err_ctl {
944 struct npc_af_kpux_err_ctl_s {
946 u64 dp_offset_errcode : 8;
947 u64 ptr_advance_errcode : 8;
948 u64 var_len_offset_errcode : 8;
949 u64 reserved_28_63 : 36;
951 /* struct npc_af_kpux_err_ctl_s cn; */
954 static inline u64 NPC_AF_KPUX_ERR_CTL(u64 a)
955 __attribute__ ((pure, always_inline));
956 static inline u64 NPC_AF_KPUX_ERR_CTL(u64 a)
958 return 0x30000a0 + 0x100 * a;
962 * Register (RVU_PF_BAR0) npc_af_kpu_diag
964 * INTERNAL : NPC AF Debug Result Registers
966 union npc_af_kpu_diag {
968 struct npc_af_kpu_diag_s {
970 u64 reserved_1_63 : 63;
972 /* struct npc_af_kpu_diag_s cn; */
975 static inline u64 NPC_AF_KPU_DIAG(void)
976 __attribute__ ((pure, always_inline));
977 static inline u64 NPC_AF_KPU_DIAG(void)
983 * Register (RVU_PF_BAR0) npc_af_lkup_ctl
985 * NPC AF Software Lookup Control Registers
987 union npc_af_lkup_ctl {
989 struct npc_af_lkup_ctl_s {
996 u64 reserved_32_63 : 32;
998 /* struct npc_af_lkup_ctl_s cn; */
1001 static inline u64 NPC_AF_LKUP_CTL(void)
1002 __attribute__ ((pure, always_inline));
1003 static inline u64 NPC_AF_LKUP_CTL(void)
1009 * Register (RVU_PF_BAR0) npc_af_lkup_data#
1011 * NPC AF Software Lookup Data Registers
1013 union npc_af_lkup_datax {
1015 struct npc_af_lkup_datax_s {
1018 /* struct npc_af_lkup_datax_s cn; */
1021 static inline u64 NPC_AF_LKUP_DATAX(u64 a)
1022 __attribute__ ((pure, always_inline));
1023 static inline u64 NPC_AF_LKUP_DATAX(u64 a)
1025 return 0x2000200 + 0x10 * a;
1029 * Register (RVU_PF_BAR0) npc_af_lkup_result#
1031 * NPC AF Software Lookup Result Registers
1033 union npc_af_lkup_resultx {
1035 struct npc_af_lkup_resultx_s {
1038 /* struct npc_af_lkup_resultx_s cn; */
1041 static inline u64 NPC_AF_LKUP_RESULTX(u64 a)
1042 __attribute__ ((pure, always_inline));
1043 static inline u64 NPC_AF_LKUP_RESULTX(u64 a)
1045 return 0x2000400 + 0x10 * a;
1049 * Register (RVU_PF_BAR0) npc_af_match_stat#
1051 * NPC AF Match Statistics Registers
1053 union npc_af_match_statx {
1055 struct npc_af_match_statx_s {
1057 u64 reserved_48_63 : 16;
1059 /* struct npc_af_match_statx_s cn; */
1062 static inline u64 NPC_AF_MATCH_STATX(u64 a)
1063 __attribute__ ((pure, always_inline));
1064 static inline u64 NPC_AF_MATCH_STATX(u64 a)
1066 return 0x1880008 + 0x100 * a;
1070 * Register (RVU_PF_BAR0) npc_af_mcam_bank#_hit#
1072 * NPC AF MCAM Bank Hit Registers
1074 union npc_af_mcam_bankx_hitx {
1076 struct npc_af_mcam_bankx_hitx_s {
1079 /* struct npc_af_mcam_bankx_hitx_s cn; */
1082 static inline u64 NPC_AF_MCAM_BANKX_HITX(u64 a, u64 b)
1083 __attribute__ ((pure, always_inline));
1084 static inline u64 NPC_AF_MCAM_BANKX_HITX(u64 a, u64 b)
1086 return 0x1c80000 + 0x100 * a + 0x10 * b;
1090 * Register (RVU_PF_BAR0) npc_af_mcam_dbg
1092 * NPC AF MCAM Debug Register This register contains information for the
1093 * last packet/lookup for which debug is enabled by
1094 * NPC_AF_DBG_CTL[INTF_DBG,LKUP_DBG].
1096 union npc_af_mcam_dbg {
1098 struct npc_af_mcam_dbg_s {
1100 u64 reserved_10_11 : 2;
1102 u64 reserved_14_15 : 2;
1104 u64 reserved_17_63 : 47;
1106 /* struct npc_af_mcam_dbg_s cn; */
1109 static inline u64 NPC_AF_MCAM_DBG(void)
1110 __attribute__ ((pure, always_inline));
1111 static inline u64 NPC_AF_MCAM_DBG(void)
1117 * Register (RVU_PF_BAR0) npc_af_mcam_scrub_ctl
1119 * NPC AF MCAM Scrub Control Register
1121 union npc_af_mcam_scrub_ctl {
1123 struct npc_af_mcam_scrub_ctl_s {
1125 u64 reserved_1_7 : 7;
1127 u64 reserved_9_15 : 7;
1129 u64 reserved_20_63 : 44;
1131 /* struct npc_af_mcam_scrub_ctl_s cn; */
1134 static inline u64 NPC_AF_MCAM_SCRUB_CTL(void)
1135 __attribute__ ((pure, always_inline));
1136 static inline u64 NPC_AF_MCAM_SCRUB_CTL(void)
1142 * Register (RVU_PF_BAR0) npc_af_mcame#_bank#_action
1144 * NPC AF MCAM Entry Bank Action Data Registers Specifies a packet's
1145 * match action captured in NPC_RESULT_S[ACTION]. When an interface is
1146 * configured to use the NPC_MCAM_KEY_X2_S search key format
1147 * (NPC_AF_INTF()_KEX_CFG[KEYW] = NPC_MCAMKEYW_E::X2), *
1148 * NPC_AF_MCAME()_BANK(0)_ACTION/_TAG_ACT/_STAT_ACT are used if the
1149 * search key matches NPC_AF_MCAME()_BANK(0..1)_CAM()_W*. *
1150 * NPC_AF_MCAME()_BANK(2)_ACTION/_TAG_ACT/_STAT_ACT are used if the
1151 * search key matches NPC_AF_MCAME()_BANK(2..3)_CAM()_W*. *
1152 * NPC_AF_MCAME()_BANK(1,3)_ACTION/_TAG_ACT/_STAT_ACT are not used. When
1153 * an interface is configured to use the NPC_MCAM_KEY_X4_S search key
1154 * format (NPC_AF_INTF()_KEX_CFG[KEYW] = NPC_MCAMKEYW_E::X4): *
1155 * NPC_AF_MCAME()_BANK(0)_ACTION/_TAG_ACT/_STAT_ACT are used if the
1156 * search key matches NPC_AF_MCAME()_BANK(0..3)_CAM()_W*. *
1157 * NPC_AF_MCAME()_BANK(1..3)_ACTION/_TAG_ACT/_STAT_ACT are not used.
1159 union npc_af_mcamex_bankx_action {
1161 struct npc_af_mcamex_bankx_action_s {
1164 /* struct npc_af_mcamex_bankx_action_s cn; */
1167 static inline u64 NPC_AF_MCAMEX_BANKX_ACTION(u64 a, u64 b)
1168 __attribute__ ((pure, always_inline));
1169 static inline u64 NPC_AF_MCAMEX_BANKX_ACTION(u64 a, u64 b)
1171 return 0x1900000 + 0x100 * a + 0x10 * b;
1175 * Register (RVU_PF_BAR0) npc_af_mcame#_bank#_cam#_intf
1177 * NPC AF MCAM Entry Bank CAM Data Interface Registers MCAM comparison
1178 * ternary data interface word. The field values in
1179 * NPC_AF_MCAME()_BANK()_CAM()_INTF, NPC_AF_MCAME()_BANK()_CAM()_W0 and
1180 * NPC_AF_MCAME()_BANK()_CAM()_W1 are ternary, where each data bit of
1181 * the search key matches as follows: _ [CAM(1)]\<n\>=0, [CAM(0)]\<n\>=0:
1182 * Always match; search key data\<n\> don't care. _ [CAM(1)]\<n\>=0,
1183 * [CAM(0)]\<n\>=1: Match when search key data\<n\> == 0. _
1184 * [CAM(1)]\<n\>=1, [CAM(0)]\<n\>=0: Match when search key data\<n\> ==
1185 * 1. _ [CAM(1)]\<n\>=1, [CAM(0)]\<n\>=1: Reserved. The reserved
1186 * combination is not allowed. Hardware suppresses any write to CAM(0) or
1187 * CAM(1) that would result in the reserved combination for any CAM bit.
1188 * The reset value for all non-reserved fields in
1189 * NPC_AF_MCAME()_BANK()_CAM()_INTF, NPC_AF_MCAME()_BANK()_CAM()_W0 and
1190 * NPC_AF_MCAME()_BANK()_CAM()_W1 is all zeros for CAM(1) and all ones
1191 * for CAM(0), matching a search key of all zeros. When an interface is
1192 * configured to use the NPC_MCAM_KEY_X1_S search key format
1193 * (NPC_AF_INTF()_KEX_CFG[KEYW] = NPC_MCAMKEYW_E::X1), the four banks of
1194 * every MCAM entry are used as individual entries, each of which is
1195 * independently compared with the search key as follows: _
1196 * NPC_AF_MCAME()_BANK()_CAM()_INTF[INTF] corresponds to
1197 * NPC_MCAM_KEY_X1_S[INTF]. _ NPC_AF_MCAME()_BANK()_CAM()_W0[MD]
1198 * corresponds to NPC_MCAM_KEY_X1_S[KW0]. _
1199 * NPC_AF_MCAME()_BANK()_CAM()_W1[MD] corresponds to
1200 * NPC_MCAM_KEY_X1_S[KW1]. When an interface is configured to use the
1201 * NPC_MCAM_KEY_X2_S search key format (NPC_AF_INTF()_KEX_CFG[KEYW] =
1202 * NPC_MCAMKEYW_E::X2), banks 0-1 of every MCAM entry are used as one
1203 * double-wide entry, banks 2-3 as a second double-wide entry, and each
1204 * double-wide entry is independently compared with the search key as
1205 * follows: _ NPC_AF_MCAME()_BANK(0,2)_CAM()_INTF[INTF] corresponds to
1206 * NPC_MCAM_KEY_X2_S[INTF]. _ NPC_AF_MCAME()_BANK(0,2)_CAM()_W0[MD]
1207 * corresponds to NPC_MCAM_KEY_X2_S[KW0]. _
1208 * NPC_AF_MCAME()_BANK(0,2)_CAM()_W1[MD] corresponds to
1209 * NPC_MCAM_KEY_X2_S[KW1]\<47:0\>. _
1210 * NPC_AF_MCAME()_BANK(1,3)_CAM()_INTF[INTF] corresponds to
1211 * NPC_MCAM_KEY_X2_S[INTF]. _
1212 * NPC_AF_MCAME()_BANK(1,3)_CAM()_W0[MD]\<15:0\> corresponds to
1213 * NPC_MCAM_KEY_X2_S[KW1]\<63:48\>. _
1214 * NPC_AF_MCAME()_BANK(1,3)_CAM()_W0[MD]\<63:16\> corresponds to
1215 * NPC_MCAM_KEY_X2_S[KW2]\<47:0\>. _
1216 * NPC_AF_MCAME()_BANK(1,3)_CAM()_W1[MD]\<15:0\> corresponds to
1217 * NPC_MCAM_KEY_X2_S[KW2]\<63:48\>. _
1218 * NPC_AF_MCAME()_BANK(1,3)_CAM()_W1[MD]\<47:16\> corresponds to
1219 * NPC_MCAM_KEY_X2_S[KW3]\<31:0\>. When an interface is configured to
1220 * use the NPC_MCAM_KEY_X4_S search key format
1221 * (NPC_AF_INTF()_KEX_CFG[KEYW] = NPC_MCAMKEYW_E::X4), the four banks of
1222 * every MCAM entry are used as a single quad-wide entry that is compared
1223 * with the search key as follows: _
1224 * NPC_AF_MCAME()_BANK(0)_CAM()_INTF[INTF] corresponds to
1225 * NPC_MCAM_KEY_X4_S[INTF]. _ NPC_AF_MCAME()_BANK(0)_CAM()_W0[MD]
1226 * corresponds to NPC_MCAM_KEY_X4_S[KW0]. _
1227 * NPC_AF_MCAME()_BANK(0)_CAM()_W1[MD] corresponds to
1228 * NPC_MCAM_KEY_X4_S[KW1]\<47:0\>. _
1229 * NPC_AF_MCAME()_BANK(1)_CAM()_INTF[INTF] corresponds to
1230 * NPC_MCAM_KEY_X4_S[INTF]. _ NPC_AF_MCAME()_BANK(1)_CAM()_W0[MD]\<15:0\>
1231 * corresponds to NPC_MCAM_KEY_X4_S[KW1]\<63:48\>. _
1232 * NPC_AF_MCAME()_BANK(1)_CAM()_W0[MD]\<63:16\> corresponds to
1233 * NPC_MCAM_KEY_X4_S[KW2]\<47:0\>. _
1234 * NPC_AF_MCAME()_BANK(1)_CAM()_W1[MD]\<15:0\> corresponds to
1235 * NPC_MCAM_KEY_X4_S[KW2]\<63:48\>. _
1236 * NPC_AF_MCAME()_BANK(1)_CAM()_W1[MD]\<47:16\> corresponds to
1237 * NPC_MCAM_KEY_X4_S[KW3]\<31:0\>. _
1238 * NPC_AF_MCAME()_BANK(2)_CAM()_INTF[INTF] corresponds to
1239 * NPC_MCAM_KEY_X4_S[INTF]. _ NPC_AF_MCAME()_BANK(2)_CAM()_W0[MD]\<31:0\>
1240 * corresponds to NPC_MCAM_KEY_X4_S[KW3]\<63:32\>. _
1241 * NPC_AF_MCAME()_BANK(2)_CAM()_W0[MD]\<63:32\> corresponds to
1242 * NPC_MCAM_KEY_X4_S[KW4]\<31:0\>. _
1243 * NPC_AF_MCAME()_BANK(2)_CAM()_W1[MD]\<31:0\> corresponds to
1244 * NPC_MCAM_KEY_X4_S[KW4]\<63:32\>. _
1245 * NPC_AF_MCAME()_BANK(2)_CAM()_W1[MD]\<47:32\> corresponds to
1246 * NPC_MCAM_KEY_X4_S[KW5]\<15:0\>. _
1247 * NPC_AF_MCAME()_BANK(3)_CAM()_INTF[INTF] corresponds to
1248 * NPC_MCAM_KEY_X4_S[INTF]. _ NPC_AF_MCAME()_BANK(3)_CAM()_W0[MD]\<47:0\>
1249 * corresponds to NPC_MCAM_KEY_X4_S[KW5]\<63:16\>. _
1250 * NPC_AF_MCAME()_BANK(3)_CAM()_W0[MD]\<63:48\> corresponds to
1251 * NPC_MCAM_KEY_X4_S[KW6]\<15:0\>. _ NPC_AF_MCAME()_BANK(3)_CAM()_W1[MD]
1252 * corresponds to NPC_MCAM_KEY_X4_S[KW6]\<63:16\>. Note that for the X2
1253 * and X4 formats, a wide entry will not match unless the INTF fields
1254 * from the associated two or four banks match the INTF value from the
1255 * search key. For the X1 and X2 formats, a match in a lower-numbered
1256 * bank takes priority over a match in any higher numbered banks. Within
1257 * each bank, the lowest numbered matching entry takes priority over any
1258 * higher numbered entry.
1260 union npc_af_mcamex_bankx_camx_intf {
1262 struct npc_af_mcamex_bankx_camx_intf_s {
1264 u64 reserved_2_63 : 62;
1266 /* struct npc_af_mcamex_bankx_camx_intf_s cn; */
1269 static inline u64 NPC_AF_MCAMEX_BANKX_CAMX_INTF(u64 a, u64 b, u64 c)
1270 __attribute__ ((pure, always_inline));
1271 static inline u64 NPC_AF_MCAMEX_BANKX_CAMX_INTF(u64 a, u64 b, u64 c)
1273 return 0x1000000 + 0x400 * a + 0x40 * b + 8 * c;
1277 * Register (RVU_PF_BAR0) npc_af_mcame#_bank#_cam#_w0
1279 * NPC AF MCAM Entry Bank CAM Data Word 0 Registers MCAM comparison
1280 * ternary data word 0. See NPC_AF_MCAME()_BANK()_CAM()_INTF.
1282 union npc_af_mcamex_bankx_camx_w0 {
1284 struct npc_af_mcamex_bankx_camx_w0_s {
1287 /* struct npc_af_mcamex_bankx_camx_w0_s cn; */
1290 static inline u64 NPC_AF_MCAMEX_BANKX_CAMX_W0(u64 a, u64 b, u64 c)
1291 __attribute__ ((pure, always_inline));
1292 static inline u64 NPC_AF_MCAMEX_BANKX_CAMX_W0(u64 a, u64 b, u64 c)
1294 return 0x1000010 + 0x400 * a + 0x40 * b + 8 * c;
1298 * Register (RVU_PF_BAR0) npc_af_mcame#_bank#_cam#_w1
1300 * NPC AF MCAM Entry Bank Data Word 1 Registers MCAM comparison ternary
1301 * data word 1. See NPC_AF_MCAME()_BANK()_CAM()_INTF.
1303 union npc_af_mcamex_bankx_camx_w1 {
1305 struct npc_af_mcamex_bankx_camx_w1_s {
1307 u64 reserved_48_63 : 16;
1309 /* struct npc_af_mcamex_bankx_camx_w1_s cn; */
1312 static inline u64 NPC_AF_MCAMEX_BANKX_CAMX_W1(u64 a, u64 b, u64 c)
1313 __attribute__ ((pure, always_inline));
1314 static inline u64 NPC_AF_MCAMEX_BANKX_CAMX_W1(u64 a, u64 b, u64 c)
1316 return 0x1000020 + 0x400 * a + 0x40 * b + 8 * c;
1320 * Register (RVU_PF_BAR0) npc_af_mcame#_bank#_cfg
1322 * NPC AF MCAM Entry Bank Configuration Registers
1324 union npc_af_mcamex_bankx_cfg {
1326 struct npc_af_mcamex_bankx_cfg_s {
1328 u64 reserved_1_63 : 63;
1330 /* struct npc_af_mcamex_bankx_cfg_s cn; */
1333 static inline u64 NPC_AF_MCAMEX_BANKX_CFG(u64 a, u64 b)
1334 __attribute__ ((pure, always_inline));
1335 static inline u64 NPC_AF_MCAMEX_BANKX_CFG(u64 a, u64 b)
1337 return 0x1800000 + 0x100 * a + 0x10 * b;
1341 * Register (RVU_PF_BAR0) npc_af_mcame#_bank#_stat_act
1343 * NPC AF MCAM Entry Bank Statistics Action Registers Used to optionally
1344 * increment a NPC_AF_MATCH_STAT() counter when a packet matches an MCAM
1345 * entry. See also NPC_AF_MCAME()_BANK()_ACTION.
1347 union npc_af_mcamex_bankx_stat_act {
1349 struct npc_af_mcamex_bankx_stat_act_s {
1352 u64 reserved_10_63 : 54;
1354 /* struct npc_af_mcamex_bankx_stat_act_s cn; */
1357 static inline u64 NPC_AF_MCAMEX_BANKX_STAT_ACT(u64 a, u64 b)
1358 __attribute__ ((pure, always_inline));
1359 static inline u64 NPC_AF_MCAMEX_BANKX_STAT_ACT(u64 a, u64 b)
1361 return 0x1880000 + 0x100 * a + 0x10 * b;
1365 * Register (RVU_PF_BAR0) npc_af_mcame#_bank#_tag_act
1367 * NPC AF MCAM Entry Bank VTag Action Data Registers Specifies a packet's
1368 * match Vtag action captured in NPC_RESULT_S[VTAG_ACTION]. See also
1369 * NPC_AF_MCAME()_BANK()_ACTION.
1371 union npc_af_mcamex_bankx_tag_act {
1373 struct npc_af_mcamex_bankx_tag_act_s {
1374 u64 vtag_action : 64;
1376 /* struct npc_af_mcamex_bankx_tag_act_s cn; */
1379 static inline u64 NPC_AF_MCAMEX_BANKX_TAG_ACT(u64 a, u64 b)
1380 __attribute__ ((pure, always_inline));
1381 static inline u64 NPC_AF_MCAMEX_BANKX_TAG_ACT(u64 a, u64 b)
1383 return 0x1900008 + 0x100 * a + 0x10 * b;
1387 * Register (RVU_PF_BAR0) npc_af_pck_cfg
1389 * NPC AF Protocol Check Configuration Register
1391 union npc_af_pck_cfg {
1393 struct npc_af_pck_cfg_s {
1402 u64 reserved_8_23 : 16;
1403 u64 iip4_cksum_errcode : 8;
1404 u64 oip4_cksum_errcode : 8;
1405 u64 reserved_40_63 : 24;
1407 /* struct npc_af_pck_cfg_s cn; */
1410 static inline u64 NPC_AF_PCK_CFG(void)
1411 __attribute__ ((pure, always_inline));
1412 static inline u64 NPC_AF_PCK_CFG(void)
1418 * Register (RVU_PF_BAR0) npc_af_pck_def_iip4
1420 * NPC AF Protocol Check Inner IPv4 Definition Register Provides layer
1421 * information used by the protocol checker to identify an inner IPv4
1424 union npc_af_pck_def_iip4 {
1426 struct npc_af_pck_def_iip4_s {
1428 u64 ltype_match : 4;
1430 u64 reserved_11_63 : 53;
1432 /* struct npc_af_pck_def_iip4_s cn; */
1435 static inline u64 NPC_AF_PCK_DEF_IIP4(void)
1436 __attribute__ ((pure, always_inline));
1437 static inline u64 NPC_AF_PCK_DEF_IIP4(void)
1443 * Register (RVU_PF_BAR0) npc_af_pck_def_oip4
1445 * NPC AF Protocol Check Outer IPv4 Definition Register Provides layer
1446 * information used by the protocol checker to identify an outer IPv4
1449 union npc_af_pck_def_oip4 {
1451 struct npc_af_pck_def_oip4_s {
1453 u64 ltype_match : 4;
1455 u64 reserved_11_63 : 53;
1457 /* struct npc_af_pck_def_oip4_s cn; */
1460 static inline u64 NPC_AF_PCK_DEF_OIP4(void)
1461 __attribute__ ((pure, always_inline));
1462 static inline u64 NPC_AF_PCK_DEF_OIP4(void)
1468 * Register (RVU_PF_BAR0) npc_af_pck_def_oip6
1470 * NPC AF Protocol Check Outer IPv6 Definition Register Provides layer
1471 * information used by the protocol checker to identify an outer IPv6
1472 * header. [LID] must have the same value as NPC_AF_PCK_DEF_OIP4[LID].
1474 union npc_af_pck_def_oip6 {
1476 struct npc_af_pck_def_oip6_s {
1478 u64 ltype_match : 4;
1480 u64 reserved_11_63 : 53;
1482 /* struct npc_af_pck_def_oip6_s cn; */
1485 static inline u64 NPC_AF_PCK_DEF_OIP6(void)
1486 __attribute__ ((pure, always_inline));
1487 static inline u64 NPC_AF_PCK_DEF_OIP6(void)
1493 * Register (RVU_PF_BAR0) npc_af_pck_def_ol2
1495 * NPC AF Protocol Check Outer L2 Definition Register Provides layer
1496 * information used by the protocol checker to identify an outer L2
1499 union npc_af_pck_def_ol2 {
1501 struct npc_af_pck_def_ol2_s {
1503 u64 ltype_match : 4;
1505 u64 reserved_11_63 : 53;
1507 /* struct npc_af_pck_def_ol2_s cn; */
1510 static inline u64 NPC_AF_PCK_DEF_OL2(void)
1511 __attribute__ ((pure, always_inline));
1512 static inline u64 NPC_AF_PCK_DEF_OL2(void)
1518 * Register (RVU_PF_BAR0) npc_af_pkind#_action0
1520 * NPC AF Port Kind Action Data 0 Registers NPC_AF_PKIND()_ACTION0 and
1521 * NPC_AF_PKIND()_ACTION1 specify the initial parse state and operations
1522 * to perform before entering KPU 0.
1524 union npc_af_pkindx_action0 {
1526 struct npc_af_pkindx_action0_s {
1527 u64 var_len_shift : 3;
1528 u64 var_len_right : 1;
1529 u64 var_len_mask : 8;
1530 u64 var_len_offset : 8;
1531 u64 ptr_advance : 8;
1532 u64 capture_flags : 8;
1533 u64 capture_ltype : 4;
1534 u64 capture_lid : 3;
1535 u64 reserved_43 : 1;
1538 u64 capture_ena : 1;
1540 u64 reserved_57_63 : 7;
1542 /* struct npc_af_pkindx_action0_s cn; */
1545 static inline u64 NPC_AF_PKINDX_ACTION0(u64 a)
1546 __attribute__ ((pure, always_inline));
1547 static inline u64 NPC_AF_PKINDX_ACTION0(u64 a)
1549 return 0x80000 + 0x40 * a;
1553 * Register (RVU_PF_BAR0) npc_af_pkind#_action1
1555 * NPC AF Port Kind Action Data 1 Registers NPC_AF_PKIND()_ACTION0 and
1556 * NPC_AF_PKIND()_ACTION1 specify the initial parse state and operations
1557 * to perform before entering KPU 0.
1559 union npc_af_pkindx_action1 {
1561 struct npc_af_pkindx_action1_s {
1567 u64 reserved_36_63 : 28;
1569 /* struct npc_af_pkindx_action1_s cn; */
1572 static inline u64 NPC_AF_PKINDX_ACTION1(u64 a)
1573 __attribute__ ((pure, always_inline));
1574 static inline u64 NPC_AF_PKINDX_ACTION1(u64 a)
1576 return 0x80008 + 0x40 * a;
1580 * Register (RVU_PF_BAR0) npc_af_pkind#_cpi_def#
1582 * NPC AF Port Kind Channel Parse Index Definition Registers These
1583 * registers specify the layer information and algorithm to compute a
1584 * packet's channel parse index (CPI), which provides a port to channel
1585 * adder for calculating NPC_RESULT_S[CHAN]. There are two CPI
1586 * definitions per port kind, allowing the CPI computation to use two
1587 * possible layer definitions in the parsed packet, e.g. DiffServ DSCP
1588 * from either IPv4 or IPv6 header. CPI pseudocode: \<pre\> for (i = 0;
1589 * i \< 2; i++) { cpi_def = NPC_AF_PKIND()_CPI_DEF(i); LX = LA, LB,
1590 * ..., or LH as selected by cpi_def[LID]; if (cpi_def[ENA] &&
1591 * ((cpi_def[LTYPE_MATCH] & cpi_def[LTYPE_MASK]) ==
1592 * (NPC_RESULT_S[LX[LTYPE]] & cpi_def[LTYPE_MASK])) &&
1593 * ((cpi_def[FLAGS_MATCH] & cpi_def[FLAGS_MASK]) ==
1594 * (NPC_RESULT_S[LX[FLAGS]] & cpi_def[FLAGS_MASK]))) { // Found
1595 * matching layer nibble_offset = (2*NPC_RESULT_S[LX[LPTR]]) +
1596 * cpi_def[ADD_OFFSET]; add_byte = byte at nibble_offset from start
1597 * of packet; cpi_add = (add_byte & cpi_def[ADD_MASK]) \>\>
1598 * cpi_def[ADD_SHIFT]; cpi = cpi_def[CPI_BASE] + cpi_add;
1599 * NPC_RESULT_S[CHAN] += NPC_AF_CPI(cpi)_CFG[PADD]; break; } }
1602 union npc_af_pkindx_cpi_defx {
1604 struct npc_af_pkindx_cpi_defx_s {
1606 u64 reserved_10_11 : 2;
1608 u64 reserved_15 : 1;
1612 u64 flags_match : 8;
1614 u64 ltype_match : 4;
1616 u64 reserved_59_62 : 4;
1619 /* struct npc_af_pkindx_cpi_defx_s cn; */
1622 static inline u64 NPC_AF_PKINDX_CPI_DEFX(u64 a, u64 b)
1623 __attribute__ ((pure, always_inline));
1624 static inline u64 NPC_AF_PKINDX_CPI_DEFX(u64 a, u64 b)
1626 return 0x80020 + 0x40 * a + 8 * b;
1629 #endif /* __CSRS_NPC_H__ */