iPXE
hermon.h
Go to the documentation of this file.
1 #ifndef _HERMON_H
2 #define _HERMON_H
3 
4 /** @file
5  *
6  * Mellanox Hermon Infiniband HCA driver
7  *
8  */
9 
10 FILE_LICENCE ( GPL2_OR_LATER );
11 
12 #include <stdint.h>
13 #include <ipxe/uaccess.h>
14 #include <ipxe/ib_packet.h>
15 #include <ipxe/bofm.h>
16 #include <ipxe/nvsvpd.h>
17 #include <ipxe/nvo.h>
18 #include "mlx_bitops.h"
19 #include "MT25408_PRM.h"
20 
21 /*
22  * Hardware constants
23  *
24  */
25 
26 /* Ports in existence */
27 #define HERMON_MAX_PORTS 2
28 #define HERMON_PORT_BASE 1
29 
30 /* PCI BARs */
31 #define HERMON_PCI_CONFIG_BAR PCI_BASE_ADDRESS_0
32 #define HERMON_PCI_CONFIG_BAR_SIZE 0x100000
33 #define HERMON_PCI_UAR_BAR PCI_BASE_ADDRESS_2
34 
35 /* Device reset */
36 #define HERMON_RESET_OFFSET 0x0f0010
37 #define HERMON_RESET_MAGIC 0x01000000UL
38 #define HERMON_RESET_WAIT_TIME_MS 1000
39 
40 /* Work queue entry and completion queue entry opcodes */
41 #define HERMON_OPCODE_NOP 0x00
42 #define HERMON_OPCODE_SEND 0x0a
43 #define HERMON_OPCODE_RECV_ERROR 0xfe
44 #define HERMON_OPCODE_SEND_ERROR 0xff
45 
46 /* HCA command register opcodes */
47 #define HERMON_HCR_QUERY_DEV_CAP 0x0003
48 #define HERMON_HCR_QUERY_FW 0x0004
49 #define HERMON_HCR_INIT_HCA 0x0007
50 #define HERMON_HCR_CLOSE_HCA 0x0008
51 #define HERMON_HCR_INIT_PORT 0x0009
52 #define HERMON_HCR_CLOSE_PORT 0x000a
53 #define HERMON_HCR_SET_PORT 0x000c
54 #define HERMON_HCR_SW2HW_MPT 0x000d
55 #define HERMON_HCR_WRITE_MTT 0x0011
56 #define HERMON_HCR_MAP_EQ 0x0012
57 #define HERMON_HCR_SW2HW_EQ 0x0013
58 #define HERMON_HCR_HW2SW_EQ 0x0014
59 #define HERMON_HCR_QUERY_EQ 0x0015
60 #define HERMON_HCR_SW2HW_CQ 0x0016
61 #define HERMON_HCR_HW2SW_CQ 0x0017
62 #define HERMON_HCR_QUERY_CQ 0x0018
63 #define HERMON_HCR_RST2INIT_QP 0x0019
64 #define HERMON_HCR_INIT2RTR_QP 0x001a
65 #define HERMON_HCR_RTR2RTS_QP 0x001b
66 #define HERMON_HCR_RTS2RTS_QP 0x001c
67 #define HERMON_HCR_2RST_QP 0x0021
68 #define HERMON_HCR_QUERY_QP 0x0022
69 #define HERMON_HCR_CONF_SPECIAL_QP 0x0023
70 #define HERMON_HCR_MAD_IFC 0x0024
71 #define HERMON_HCR_READ_MCG 0x0025
72 #define HERMON_HCR_WRITE_MCG 0x0026
73 #define HERMON_HCR_MGID_HASH 0x0027
74 #define HERMON_HCR_MOD_STAT_CFG 0x0034
75 #define HERMON_HCR_QUERY_PORT 0x0043
76 #define HERMON_HCR_SENSE_PORT 0x004d
77 #define HERMON_HCR_RUN_FW 0x0ff6
78 #define HERMON_HCR_DISABLE_LAM 0x0ff7
79 #define HERMON_HCR_ENABLE_LAM 0x0ff8
80 #define HERMON_HCR_UNMAP_ICM 0x0ff9
81 #define HERMON_HCR_MAP_ICM 0x0ffa
82 #define HERMON_HCR_UNMAP_ICM_AUX 0x0ffb
83 #define HERMON_HCR_MAP_ICM_AUX 0x0ffc
84 #define HERMON_HCR_SET_ICM_SIZE 0x0ffd
85 #define HERMON_HCR_UNMAP_FA 0x0ffe
86 #define HERMON_HCR_MAP_FA 0x0fff
87 
88 /* Service types */
89 #define HERMON_ST_RC 0x00
90 #define HERMON_ST_UD 0x03
91 #define HERMON_ST_MLX 0x07
92 
93 /* Port types */
94 #define HERMON_PORT_TYPE_UNKNOWN 0
95 #define HERMON_PORT_TYPE_IB 1
96 #define HERMON_PORT_TYPE_ETH 2
97 
98 /* MTUs */
99 #define HERMON_MTU_2048 0x04
100 #define HERMON_MTU_ETH 0x07
101 
102 #define HERMON_INVALID_LKEY 0x00000100UL
103 
104 #define HERMON_PAGE_SIZE ( ( size_t ) 4096 )
105 
106 #define HERMON_DB_POST_SND_OFFSET 0x14
107 #define HERMON_DB_EQ_OFFSET(_eqn) \
108  ( 0x800 + HERMON_PAGE_SIZE * ( (_eqn) / 4 ) + 0x08 * ( (_eqn) % 4 ) )
109 
110 #define HERMON_QP_OPT_PARAM_PM_STATE 0x00000400UL
111 #define HERMON_QP_OPT_PARAM_QKEY 0x00000020UL
112 #define HERMON_QP_OPT_PARAM_ALT_PATH 0x00000001UL
113 
114 #define HERMON_MAP_EQ ( 0UL << 31 )
115 #define HERMON_UNMAP_EQ ( 1UL << 31 )
116 
117 #define HERMON_SET_PORT_GENERAL_PARAM 0x0000
118 #define HERMON_SET_PORT_RECEIVE_QP 0x0100
119 #define HERMON_SET_PORT_MAC_TABLE 0x0200
120 #define HERMON_SET_PORT_VLAN_TABLE 0x0300
121 #define HERMON_SET_PORT_PRIORITY_TABLE 0x0400
122 #define HERMON_SET_PORT_GID_TABLE 0x0500
123 
124 #define HERMON_EV_PORT_STATE_CHANGE 0x09
125 
126 #define HERMON_SCHED_QP0 0x3f
127 #define HERMON_SCHED_DEFAULT 0x83
128 
129 #define HERMON_LOG_MULTICAST_HASH_SIZE 7
130 
131 #define HERMON_PM_STATE_ARMED 0x00
132 #define HERMON_PM_STATE_REARM 0x01
133 #define HERMON_PM_STATE_MIGRATED 0x03
134 
135 #define HERMON_RETRY_MAX 0x07
136 
137 #define HERMON_MOD_STAT_CFG_SET 0x01
138 #define HERMON_MOD_STAT_CFG_QUERY 0x03
139 
140 #define HERMON_VPD_FIELD( port ) \
141  PCI_VPD_FIELD ( PCI_VPD_TAG_RW, 'V', ( '5' + (port) - 1 ) )
142 
143 /*
144  * Datatypes that seem to be missing from the autogenerated documentation
145  *
146  */
149 /* -------------- */
150  pseudo_bit_t hash[0x00010];
152 } __attribute__ (( packed ));
153 
157 } __attribute__ (( packed ));
158 
162 /* -------------- */
164  pseudo_bit_t cmd[0x00003];
168 } __attribute__ (( packed ));
169 
172  pseudo_bit_t qn[0x00018];
173 } __attribute__ (( packed ));
174 
176  pseudo_bit_t ci[0x00018];
178  pseudo_bit_t a[0x00001];
179 } __attribute__ (( packed ));
180 
183 /* -------------- */
184  pseudo_bit_t value[0x00020];
185 } __attribute__ (( packed ));
186 
189 /* -------------- */
208  pseudo_bit_t gpio[0x00001];
211 } __attribute__ (( packed ));
212 
215 /* -------------- */
217 } __attribute__ (( packed ));
218 
221 /* -------------- */
224 } __attribute__ (( packed ));
225 
227  pseudo_bit_t rqk[0x00001];
228  pseudo_bit_t rcm[0x00001];
233  pseudo_bit_t g0[0x00001];
234  pseudo_bit_t ng[0x00001];
235  pseudo_bit_t sig[0x00001];
236  pseudo_bit_t mg[0x00001];
237  pseudo_bit_t mp[0x00001];
238  pseudo_bit_t mvc[0x00001];
239  pseudo_bit_t mmc[0x00001];
241  pseudo_bit_t lws[0x00001];
242  pseudo_bit_t lss[0x00001];
244 /* -------------- */
246 /* -------------- */
248 /* -------------- */
250 /* -------------- */
252 /* -------------- */
254 /* -------------- */
256 /* -------------- */
258 /* -------------- */
262 /* -------------- */
266 /* -------------- */
269 /* -------------- */
271 /* -------------- */
273 /* -------------- */
275 /* -------------- */
277 /* -------------- */
279 /* -------------- */
281 /* -------------- */
283 /* -------------- */
285 /* -------------- */
287 /* -------------- */
289 /* -------------- */
291 /* -------------- */
293 /* -------------- */
295 /* -------------- */
297 /* -------------- */
299 /* -------------- */
301 /* -------------- */
303 /* -------------- */
307 /* -------------- */
308 } __attribute__ (( packed ));
309 
314  pseudo_bit_t ib[0x00001];
315  pseudo_bit_t eth[0x00001];
318 /* -------------- */
327 /* -------------- */
333 /* -------------- */
335 /* -------------- */
338 /* -------------- */
340 /* -------------- */
343 /* -------------- */
346 /* -------------- */
348 /* -------------- */
350 /* -------------- */
352 } __attribute__ (( packed ));
353 
355  pseudo_bit_t v_mtu[0x00001];
359 /* -------------- */
360  pseudo_bit_t mtu[0x00010];
362 /* -------------- */
364  pseudo_bit_t pfctx[0x00008];
366  pseudo_bit_t pptx[0x00001];
367 /* -------------- */
369  pseudo_bit_t pfcrx[0x00008];
371  pseudo_bit_t pprx[0x00001];
372 /* -------------- */
373 } __attribute__ (( packed ));
374 
378 /* -------------- */
379  pseudo_bit_t n_p[0x00002];
381  pseudo_bit_t n_v[0x00003];
383  pseudo_bit_t n_m[0x00004];
385 /* -------------- */
388 /* -------------- */
395 /* -------------- */
398 /* -------------- */
402 /* -------------- */
407 /* -------------- */
409 /* -------------- */
410 } __attribute__ (( packed ));
411 
413  pseudo_bit_t mac_h[0x00010];
415  pseudo_bit_t v[0x00001];
416 /* -------------- */
417  pseudo_bit_t mac_l[0x00020];
418 /* -------------- */
419 } __attribute__ (( packed ));
420 
424  pseudo_bit_t intra[0x00001];
425  pseudo_bit_t v[0x00001];
426 /* -------------- */
427 } __attribute__ (( packed ));
428 
432  pseudo_bit_t xnum[0x00004];
437 } __attribute__ (( packed ));
438 
439 /*
440  * Wrapper structures for hardware datatypes
441  *
442  */
443 
444 struct MLX_DECLARE_STRUCT ( hermonprm_completion_queue_context );
445 struct MLX_DECLARE_STRUCT ( hermonprm_completion_queue_entry );
446 struct MLX_DECLARE_STRUCT ( hermonprm_completion_with_error );
447 struct MLX_DECLARE_STRUCT ( hermonprm_cq_db_record );
448 struct MLX_DECLARE_STRUCT ( hermonprm_eqc );
449 struct MLX_DECLARE_STRUCT ( hermonprm_event_db_register );
450 struct MLX_DECLARE_STRUCT ( hermonprm_event_mask );
451 struct MLX_DECLARE_STRUCT ( hermonprm_event_queue_entry );
452 struct MLX_DECLARE_STRUCT ( hermonprm_hca_command_register );
453 struct MLX_DECLARE_STRUCT ( hermonprm_init_hca );
454 struct MLX_DECLARE_STRUCT ( hermonprm_mad_ifc );
455 struct MLX_DECLARE_STRUCT ( hermonprm_mcg_entry );
456 struct MLX_DECLARE_STRUCT ( hermonprm_mgm_hash );
457 struct MLX_DECLARE_STRUCT ( hermonprm_mod_stat_cfg );
458 struct MLX_DECLARE_STRUCT ( hermonprm_mod_stat_cfg_input_mod );
459 struct MLX_DECLARE_STRUCT ( hermonprm_mpt );
460 struct MLX_DECLARE_STRUCT ( hermonprm_mtt );
461 struct MLX_DECLARE_STRUCT ( hermonprm_port_state_change_event );
462 struct MLX_DECLARE_STRUCT ( hermonprm_qp_db_record );
463 struct MLX_DECLARE_STRUCT ( hermonprm_qp_ee_state_transitions );
464 struct MLX_DECLARE_STRUCT ( hermonprm_query_dev_cap );
465 struct MLX_DECLARE_STRUCT ( hermonprm_query_fw );
466 struct MLX_DECLARE_STRUCT ( hermonprm_query_port_cap );
467 struct MLX_DECLARE_STRUCT ( hermonprm_queue_pair_ee_context_entry );
468 struct MLX_DECLARE_STRUCT ( hermonprm_scalar_parameter );
469 struct MLX_DECLARE_STRUCT ( hermonprm_sense_port );
470 struct MLX_DECLARE_STRUCT ( hermonprm_send_db_register );
471 struct MLX_DECLARE_STRUCT ( hermonprm_set_port_ib );
472 struct MLX_DECLARE_STRUCT ( hermonprm_set_port_general_context );
473 struct MLX_DECLARE_STRUCT ( hermonprm_set_port_mac_table );
474 struct MLX_DECLARE_STRUCT ( hermonprm_set_port_rqp_calc );
475 struct MLX_DECLARE_STRUCT ( hermonprm_set_port_vlan );
476 struct MLX_DECLARE_STRUCT ( hermonprm_ud_address_vector );
477 struct MLX_DECLARE_STRUCT ( hermonprm_virtual_physical_mapping );
478 struct MLX_DECLARE_STRUCT ( hermonprm_wqe_segment_ctrl_mlx );
479 struct MLX_DECLARE_STRUCT ( hermonprm_wqe_segment_ctrl_send );
480 struct MLX_DECLARE_STRUCT ( hermonprm_wqe_segment_data_ptr );
481 struct MLX_DECLARE_STRUCT ( hermonprm_wqe_segment_ud );
482 
483 /*
484  * Composite hardware datatypes
485  *
486  */
487 
489  struct hermonprm_scalar_parameter mtt_base_addr;
490  struct hermonprm_scalar_parameter reserved;
491  struct hermonprm_mtt mtt;
492 } __attribute__ (( packed ));
493 
494 #define HERMON_MAX_GATHER 2
495 
497  struct hermonprm_wqe_segment_ctrl_send ctrl;
498  struct hermonprm_wqe_segment_ud ud;
499  struct hermonprm_wqe_segment_data_ptr data[HERMON_MAX_GATHER];
500 } __attribute__ (( packed ));
501 
503  struct hermonprm_wqe_segment_ctrl_mlx ctrl;
504  struct hermonprm_wqe_segment_data_ptr data[HERMON_MAX_GATHER];
506 } __attribute__ (( packed ));
507 
509  struct hermonprm_wqe_segment_ctrl_send ctrl;
510  struct hermonprm_wqe_segment_data_ptr data[HERMON_MAX_GATHER];
511 } __attribute__ (( packed ));
512 
514  struct hermonprm_wqe_segment_ctrl_send ctrl;
515  struct hermonprm_wqe_segment_data_ptr data[HERMON_MAX_GATHER];
516 } __attribute__ (( packed ));
517 
518 #define HERMON_MAX_SCATTER 2
519 
521  struct hermonprm_wqe_segment_data_ptr data[HERMON_MAX_SCATTER];
522 } __attribute__ (( packed ));
523 
525  struct hermonprm_completion_queue_entry normal;
526  struct hermonprm_completion_with_error error;
527 } __attribute__ (( packed ));
528 
530  struct hermonprm_event_queue_entry generic;
531  struct hermonprm_port_state_change_event port_state_change;
532 } __attribute__ (( packed ));
533 
535  struct hermonprm_send_db_register send;
536  struct hermonprm_event_db_register event;
538 } __attribute__ (( packed ));
539 
541  struct hermonprm_mad_ifc ifc;
542  union ib_mad mad;
543 } __attribute__ (( packed ));
544 
546  struct hermonprm_set_port_ib ib;
547  struct hermonprm_set_port_general_context general;
548  struct hermonprm_set_port_rqp_calc rqp_calc;
549  struct hermonprm_set_port_mac_table mac_table[128];
550  struct hermonprm_set_port_vlan vlan;
551 } __attribute__ (( packed ));
552 
553 /*
554  * iPXE-specific definitions
555  *
556  */
557 
558 /** Hermon device capabilitiess */
560  /** CMPT entry size */
562  /** Number of reserved QPs */
563  unsigned int reserved_qps;
564  /** QP context entry size */
566  /** Alternate path context entry size */
568  /** Auxiliary context entry size */
570  /** Number of reserved SRQs */
571  unsigned int reserved_srqs;
572  /** SRQ context entry size */
574  /** Number of reserved CQs */
575  unsigned int reserved_cqs;
576  /** CQ context entry size */
578  /** Number of reserved EQs */
579  unsigned int reserved_eqs;
580  /** EQ context entry size */
582  /** Number of reserved MTTs */
583  unsigned int reserved_mtts;
584  /** MTT entry size */
586  /** Number of reserved MRWs */
587  unsigned int reserved_mrws;
588  /** DMPT entry size */
590  /** Number of reserved UARs */
591  unsigned int reserved_uars;
592  /** Number of ports */
593  unsigned int num_ports;
594  /** Dual-port different protocol */
595  int dpdp;
596 };
597 
598 /** Number of cMPT entries of each type */
599 #define HERMON_CMPT_MAX_ENTRIES ( 1 << 24 )
600 
601 /** Hermon ICM memory map entry */
603  /** Offset (virtual address within ICM) */
605  /** Length */
606  size_t len;
607 };
608 
609 /** Discontiguous regions within Hermon ICM */
617 };
618 
619 /** UAR page for doorbell accesses
620  *
621  * Pages 0-127 are reserved for event queue doorbells only, so we use
622  * page 128.
623  */
624 #define HERMON_UAR_NON_EQ_PAGE 128
625 
626 /** Maximum number of allocatable MTT entries
627  *
628  * This is a policy decision, not a device limit.
629  */
630 #define HERMON_MAX_MTTS 64
631 
632 /** A Hermon MTT descriptor */
633 struct hermon_mtt {
634  /** MTT offset */
635  unsigned int mtt_offset;
636  /** Number of pages */
637  unsigned int num_pages;
638  /** MTT base address */
639  unsigned int mtt_base_addr;
640  /** Offset within page */
641  unsigned int page_offset;
642 };
643 
644 /** Alignment of Hermon send work queue entries */
645 #define HERMON_SEND_WQE_ALIGN 128
646 
647 /** A Hermon send work queue entry */
649  struct hermonprm_wqe_segment_ctrl_send ctrl;
655 } __attribute__ (( packed ));
656 
657 /** A Hermon send work queue */
659  /** Number of work queue entries, including headroom
660  *
661  * Hermon requires us to leave unused space within the send
662  * WQ, so we create a send WQ with more entries than are
663  * requested in the create_qp() call.
664  */
665  unsigned int num_wqes;
666  /** Work queue entries */
668  /** Size of work queue */
669  size_t wqe_size;
670  /** Doorbell register */
671  void *doorbell;
672 };
673 
674 /** Alignment of Hermon receive work queue entries */
675 #define HERMON_RECV_WQE_ALIGN 16
676 
677 /** A Hermon receive work queue entry */
681 } __attribute__ (( packed ));
682 
683 /** A Hermon receive work queue */
685  /** Work queue entries */
687  /** Size of work queue */
688  size_t wqe_size;
689  /** GRH buffers (if applicable) */
691  /** Size of GRH buffers */
692  size_t grh_size;
693  /** Doorbell record */
694  struct hermonprm_qp_db_record *doorbell;
695 };
696 
697 /** Number of special queue pairs */
698 #define HERMON_NUM_SPECIAL_QPS 8
699 
700 /** Number of queue pairs reserved for the "special QP" block
701  *
702  * The special QPs must be within a contiguous block aligned on its
703  * own size.
704  */
705 #define HERMON_RSVD_SPECIAL_QPS ( ( HERMON_NUM_SPECIAL_QPS << 1 ) - 1 )
706 
707 /** Maximum number of allocatable queue pairs
708  *
709  * This is a policy decision, not a device limit.
710  */
711 #define HERMON_MAX_QPS 8
712 
713 /** Queue pair number randomisation mask */
714 #define HERMON_QPN_RANDOM_MASK 0xfff000
715 
716 /** Hermon queue pair state */
722 };
723 
724 /** A Hermon queue pair */
726  /** Work queue buffer */
727  void *wqe;
728  /** Size of work queue buffer */
729  size_t wqe_size;
730  /** MTT descriptor */
731  struct hermon_mtt mtt;
732  /** Send work queue */
734  /** Receive work queue */
736  /** Queue state */
738 };
739 
740 /** Maximum number of allocatable completion queues
741  *
742  * This is a policy decision, not a device limit.
743  */
744 #define HERMON_MAX_CQS 8
745 
746 /** A Hermon completion queue */
748  /** Completion queue entries */
750  /** Size of completion queue */
751  size_t cqe_size;
752  /** MTT descriptor */
753  struct hermon_mtt mtt;
754  /** Doorbell record */
755  struct hermonprm_cq_db_record *doorbell;
756 };
757 
758 /** Maximum number of allocatable event queues
759  *
760  * This is a policy decision, not a device limit.
761  */
762 #define HERMON_MAX_EQS 8
763 
764 /** A Hermon event queue */
766  /** Event queue entries */
768  /** Size of event queue */
769  size_t eqe_size;
770  /** MTT descriptor */
771  struct hermon_mtt mtt;
772  /** Event queue number */
773  unsigned long eqn;
774  /** Next event queue entry index */
775  unsigned long next_idx;
776  /** Doorbell register */
777  void *doorbell;
778 };
779 
780 /** Number of event queue entries
781  *
782  * This is a policy decision.
783  */
784 #define HERMON_NUM_EQES 8
785 
786 /** A Hermon resource bitmask */
788 
789 /** Size of a hermon resource bitmask */
790 #define HERMON_BITMASK_SIZE(max_entries) \
791  ( ( (max_entries) + ( 8 * sizeof ( hermon_bitmask_t ) ) - 1 ) / \
792  ( 8 * sizeof ( hermon_bitmask_t ) ) )
793 
794 struct hermon;
795 struct hermon_port;
796 
797 /** A Hermon port type */
799  /** Register port
800  *
801  * @v hermon Hermon device
802  * @v port Hermon port
803  * @ret rc Return status code
804  */
805  int ( * register_dev ) ( struct hermon *hermon,
806  struct hermon_port *port );
807  /** Port state changed
808  *
809  * @v hermon Hermon device
810  * @v port Hermon port
811  * @v link_up Link is up
812  */
813  void ( * state_change ) ( struct hermon *hermon,
814  struct hermon_port *port,
815  int link_up );
816  /** Unregister port
817  *
818  * @v hermon Hermon device
819  * @v port Hermon port
820  */
821  void ( * unregister_dev ) ( struct hermon *hermon,
822  struct hermon_port *port );
823 };
824 
825 /** A Hermon port */
826 struct hermon_port {
827  /** Infiniband device */
828  struct ib_device *ibdev;
829  /** Network device */
831  /** Ethernet completion queue */
833  /** Ethernet queue pair */
835  /** Port type */
837  /** Non-volatile option storage */
838  struct nvo_block nvo;
839 };
840 
841 /** A Hermon device */
842 struct hermon {
843  /** PCI device */
844  struct pci_device *pci;
845  /** PCI configuration registers */
846  void *config;
847  /** PCI user Access Region */
848  void *uar;
849 
850  /** Command toggle */
851  unsigned int toggle;
852  /** Command input mailbox */
853  void *mailbox_in;
854  /** Command output mailbox */
855  void *mailbox_out;
856 
857  /** Device open request counter */
858  unsigned int open_count;
859 
860  /** Firmware size */
861  size_t firmware_len;
862  /** Firmware area in external memory
863  *
864  * This is allocated when first needed, and freed only on
865  * final teardown, in order to avoid memory map changes at
866  * runtime.
867  */
869  /** ICM map */
871  /** ICM size */
872  size_t icm_len;
873  /** ICM AUX size */
874  size_t icm_aux_len;
875  /** ICM area
876  *
877  * This is allocated when first needed, and freed only on
878  * final teardown, in order to avoid memory map changes at
879  * runtime.
880  */
882 
883  /** Event queue */
885  /** Unrestricted LKey
886  *
887  * Used to get unrestricted memory access.
888  */
889  unsigned long lkey;
890 
891  /** Completion queue in-use bitmask */
893  /** Queue pair in-use bitmask */
895  /** MTT entry in-use bitmask */
897 
898  /** Device capabilities */
900  /** Special QPN base */
901  unsigned long special_qpn_base;
902  /** QPN base */
903  unsigned long qpn_base;
904 
905  /** Non-volatile storage in PCI VPD */
907 
908  /** Ports */
910 
911  /** BOFM device */
913 };
914 
915 /** Global protection domain */
916 #define HERMON_GLOBAL_PD 0x123456
917 
918 /** Memory key prefix */
919 #define HERMON_MKEY_PREFIX 0x77000000UL
920 
921 /*
922  * HCA commands
923  *
924  */
925 
926 #define HERMON_HCR_BASE 0x80680
927 #define HERMON_HCR_REG(x) ( HERMON_HCR_BASE + 4 * (x) )
928 #define HERMON_HCR_MAX_WAIT_MS 2000
929 #define HERMON_MBOX_ALIGN 4096
930 #define HERMON_MBOX_SIZE 1024
931 
932 /* HCA command is split into
933  *
934  * bits 11:0 Opcode
935  * bit 12 Input uses mailbox
936  * bit 13 Output uses mailbox
937  * bits 22:14 Input parameter length (in dwords)
938  * bits 31:23 Output parameter length (in dwords)
939  *
940  * Encoding the information in this way allows us to cut out several
941  * parameters to the hermon_command() call.
942  */
943 #define HERMON_HCR_IN_MBOX 0x00001000UL
944 #define HERMON_HCR_OUT_MBOX 0x00002000UL
945 #define HERMON_HCR_OPCODE( _command ) ( (_command) & 0xfff )
946 #define HERMON_HCR_IN_LEN( _command ) ( ( (_command) >> 12 ) & 0x7fc )
947 #define HERMON_HCR_OUT_LEN( _command ) ( ( (_command) >> 21 ) & 0x7fc )
948 
949 /** Build HCR command from component parts */
950 #define HERMON_HCR_INOUT_CMD( _opcode, _in_mbox, _in_len, \
951  _out_mbox, _out_len ) \
952  ( (_opcode) | \
953  ( (_in_mbox) ? HERMON_HCR_IN_MBOX : 0 ) | \
954  ( ( (_in_len) / 4 ) << 14 ) | \
955  ( (_out_mbox) ? HERMON_HCR_OUT_MBOX : 0 ) | \
956  ( ( (_out_len) / 4 ) << 23 ) )
957 
958 #define HERMON_HCR_IN_CMD( _opcode, _in_mbox, _in_len ) \
959  HERMON_HCR_INOUT_CMD ( _opcode, _in_mbox, _in_len, 0, 0 )
960 
961 #define HERMON_HCR_OUT_CMD( _opcode, _out_mbox, _out_len ) \
962  HERMON_HCR_INOUT_CMD ( _opcode, 0, 0, _out_mbox, _out_len )
963 
964 #define HERMON_HCR_VOID_CMD( _opcode ) \
965  HERMON_HCR_INOUT_CMD ( _opcode, 0, 0, 0, 0 )
966 
967 #endif /* _HERMON_H */
pseudo_bit_t no_vlan_prio[0x00003]
Definition: hermon.h:396
size_t eqe_size
Size of event queue.
Definition: hermon.h:769
struct ib_completion_queue * eth_cq
Ethernet completion queue.
Definition: hermon.h:832
pseudo_bit_t reserved[0x00020]
Definition: hermon.h:214
pseudo_bit_t srq_catastrophe[0x00001]
Definition: hermon.h:205
#define __attribute__(x)
Definition: compiler.h:10
hermon_queue_pair_state
Hermon queue pair state.
Definition: hermon.h:717
struct hermonprm_mcg_qp_dw_st qp[8]
Definition: hermon.h:156
pseudo_bit_t rcm[0x00001]
Definition: hermon.h:228
struct ib_device * ibdev
Infiniband device.
Definition: hermon.h:828
struct net_device * netdev
Network device.
Definition: hermon.h:830
struct hermonprm_set_port_rqp_calc rqp_calc
Definition: hermon.h:548
struct hermon_send_work_queue send
Send work queue.
Definition: hermon.h:733
pseudo_bit_t reserved2[0x00005]
Definition: hermon.h:382
struct hermon_mtt mtt
MTT descriptor.
Definition: hermon.h:753
pseudo_bit_t command_done[0x00001]
Definition: hermon.h:200
pseudo_bit_t pprx[0x00001]
Definition: hermon.h:371
hermon_icm_map_regions
Discontiguous regions within Hermon ICM.
Definition: hermon.h:610
pseudo_bit_t reserved1[0x00004]
Definition: hermon.h:202
pseudo_bit_t vl_cap[0x00004]
Definition: hermon.h:230
struct hermonprm_wqe_segment_data_ptr data[HERMON_MAX_GATHER]
Definition: hermon.h:510
struct hermonprm_event_db_register event
Definition: hermon.h:536
pseudo_bit_t reserved1[0x00010]
Definition: hermon.h:151
size_t auxc_entry_size
Auxiliary context entry size.
Definition: hermon.h:569
struct hermon_recv_work_queue recv
Receive work queue.
Definition: hermon.h:735
pseudo_bit_t vendor_oui[0x00018]
Definition: hermon.h:341
pseudo_bit_t reserved13[0x00020]
Definition: hermon.h:284
pseudo_bit_t egress_sniff_qpn[0x00018]
Definition: hermon.h:259
void * doorbell
Doorbell register.
Definition: hermon.h:671
An NVS VPD device.
Definition: nvsvpd.h:20
struct hermonprm_send_db_register send
Definition: hermon.h:535
pseudo_bit_t reserved2[0x00009]
Definition: hermon.h:210
struct hermonprm_recv_wqe recv
Definition: hermon.h:679
pseudo_bit_t reserved15[0x00020]
Definition: hermon.h:288
pseudo_bit_t reserved0[0x00004]
Definition: hermon.h:313
size_t cqc_entry_size
CQ context entry size.
Definition: hermon.h:577
pseudo_bit_t reserved0[0x0001d]
Definition: hermon.h:358
pseudo_bit_t log_max_mac[0x00004]
Definition: hermon.h:330
void * mailbox_in
Command input mailbox.
Definition: hermon.h:853
pseudo_bit_t log_max_gid[0x00004]
Definition: hermon.h:320
pseudo_bit_t reserved7[0x00020]
Definition: hermon.h:334
#define HERMON_SEND_WQE_ALIGN
Alignment of Hermon send work queue entries.
Definition: hermon.h:645
Non-Volatile Storage using Vital Product Data.
pseudo_bit_t ingress_sniff_mode[0x00002]
Definition: hermon.h:264
size_t mtt_entry_size
MTT entry size.
Definition: hermon.h:585
pseudo_bit_t lws[0x00001]
Definition: hermon.h:241
pseudo_bit_t reserved3[0x0000c]
Definition: hermon.h:384
pseudo_bit_t autoneg[0x00001]
Definition: hermon.h:434
pseudo_bit_t reserved12[0x00020]
Definition: hermon.h:282
pseudo_bit_t fexch_error[0x00001]
Definition: hermon.h:201
pseudo_bit_t no_vlan_index[0x00007]
Definition: hermon.h:392
pseudo_bit_t value[0x00020]
Definition: hermon.h:184
pseudo_bit_t transceiver_type[0x00008]
Definition: hermon.h:342
pseudo_bit_t eth_mtu[0x00010]
Definition: hermon.h:311
pseudo_bit_t reserved9[0x00020]
Definition: hermon.h:276
pseudo_bit_t setup_mode[0x00004]
Definition: hermon.h:436
pseudo_bit_t reserved9[0x00010]
Definition: hermon.h:344
pseudo_bit_t link_speed_supported[0x00004]
Definition: hermon.h:305
struct MLX_DECLARE_STRUCT(hermonprm_completion_queue_context)
pseudo_bit_t mvc[0x00001]
Definition: hermon.h:238
pseudo_bit_t reserved17[0x00020]
Definition: hermon.h:292
unsigned long long uint64_t
Definition: stdint.h:13
pseudo_bit_t reserved0[0x00020]
Definition: hermon.h:220
unsigned long special_qpn_base
Special QPN base.
Definition: hermon.h:901
pseudo_bit_t mc_by_vlan[0x00001]
Definition: hermon.h:405
pseudo_bit_t rqk[0x00001]
Definition: hermon.h:227
pseudo_bit_t reserved5[0x00004]
Definition: hermon.h:329
pseudo_bit_t intra[0x00001]
Definition: hermon.h:424
pseudo_bit_t reserver[0x00007]
Definition: hermon.h:177
pseudo_bit_t srq_rq_limit[0x00001]
Definition: hermon.h:207
pseudo_bit_t mtu_cap[0x00004]
Definition: hermon.h:232
pseudo_bit_t mg[0x00001]
Definition: hermon.h:236
pseudo_bit_t reserved18[0x00020]
Definition: hermon.h:294
A Hermon send work queue entry.
Definition: hermon.h:648
pseudo_bit_t reserved5[0x00008]
Definition: hermon.h:390
Hermon ICM memory map entry.
Definition: hermon.h:602
pseudo_bit_t ib_mtu[0x00004]
Definition: hermon.h:312
pseudo_bit_t reserved[0x00008]
Definition: hermon.h:171
pseudo_bit_t reserved16[0x00020]
Definition: hermon.h:290
A Hermon completion queue.
Definition: hermon.h:747
pseudo_bit_t reserved20[0x00020]
Definition: hermon.h:298
unsigned char pseudo_bit_t
Datatype used to represent a bit in the pseudo-structures.
Definition: nx_bitops.h:37
pseudo_bit_t pfctx[0x00008]
Definition: hermon.h:364
pseudo_bit_t reserved11[0x00020]
Definition: hermon.h:280
unsigned int mtt_offset
MTT offset.
Definition: hermon.h:635
union hermonprm_event_entry * eqe
Event queue entries.
Definition: hermon.h:767
struct hermonprm_wqe_segment_ctrl_mlx ctrl
Definition: hermon.h:503
pseudo_bit_t cq_error[0x00001]
Definition: hermon.h:194
pseudo_bit_t v_pptx[0x00001]
Definition: hermon.h:357
unsigned int reserved_cqs
Number of reserved CQs.
Definition: hermon.h:575
userptr_t firmware_area
Firmware area in external memory.
Definition: hermon.h:868
size_t cqe_size
Size of completion queue.
Definition: hermon.h:751
pseudo_bit_t wq_invalid_request[0x00001]
Definition: hermon.h:203
Access to external ("user") memory.
struct hermonprm_qp_db_record * doorbell
Doorbell record.
Definition: hermon.h:694
enum hermon_queue_pair_state state
Queue state.
Definition: hermon.h:737
pseudo_bit_t reserved8[0x00010]
Definition: hermon.h:337
struct hermonprm_set_port_general_context general
Definition: hermon.h:547
A Hermon port type.
Definition: hermon.h:798
pseudo_bit_t mac_miss_index[0x00008]
Definition: hermon.h:386
FILE_LICENCE(GPL2_OR_LATER)
void(* unregister_dev)(struct hermon *hermon, struct hermon_port *port)
Unregister port.
Definition: hermon.h:821
pseudo_bit_t n_p[0x00002]
Definition: hermon.h:379
pseudo_bit_t reserved7[0x0001d]
Definition: hermon.h:397
pseudo_bit_t system_image_guid_l[0x00020]
Definition: hermon.h:249
struct bofm_device bofm
BOFM device.
Definition: hermon.h:912
pseudo_bit_t arm_ci[0x00018]
Definition: hermon.h:163
pseudo_bit_t wq_catastrophe[0x00001]
Definition: hermon.h:195
pseudo_bit_t reserved3[0x00007]
Definition: hermon.h:365
pseudo_bit_t qpc_catastrophe[0x00001]
Definition: hermon.h:196
Definition: hermon.h:524
union hermon_recv_wqe * wqe
Work queue entries.
Definition: hermon.h:686
struct hermonprm_wqe_segment_data_ptr data[HERMON_MAX_GATHER]
Definition: hermon.h:515
struct hermonprm_wqe_segment_ctrl_send ctrl
Definition: hermon.h:514
struct hermonprm_mcg_hdr_st hdr
Definition: hermon.h:155
pseudo_bit_t g0[0x00001]
Definition: hermon.h:233
An Infiniband device.
Definition: infiniband.h:398
pseudo_bit_t reserved9[0x00005]
Definition: hermon.h:404
struct hermon_mtt mtt
MTT descriptor.
Definition: hermon.h:771
pseudo_bit_t reserved0[0x00020]
Definition: hermon.h:148
pseudo_bit_t completion[0x00001]
Definition: hermon.h:190
struct hermonprm_scalar_parameter reserved
Definition: hermon.h:490
unsigned int mtt_base_addr
MTT base address.
Definition: hermon.h:639
Mellanox bit operations.
hermon_bitmask_t cq_inuse[HERMON_BITMASK_SIZE(HERMON_MAX_CQS)]
Completion queue in-use bitmask.
Definition: hermon.h:892
unsigned int num_ports
Number of ports.
Definition: hermon.h:593
struct hermonprm_wqe_segment_data_ptr data[HERMON_MAX_GATHER]
Definition: hermon.h:504
u8 port
Port number.
Definition: CIB_PRM.h:31
void * mailbox_out
Command output mailbox.
Definition: hermon.h:855
pseudo_bit_t node_guid_h[0x00020]
Definition: hermon.h:255
uint32_t hermon_bitmask_t
A Hermon resource bitmask.
Definition: hermon.h:787
IBM BladeCenter Open Fabric Manager (BOFM)
pseudo_bit_t ci[0x00018]
Definition: hermon.h:176
size_t wqe_size
Size of work queue buffer.
Definition: hermon.h:729
pseudo_bit_t reserved5[0x00007]
Definition: hermon.h:370
struct hermonprm_eth_send_wqe eth
Definition: hermon.h:653
struct hermonprm_mad_ifc ifc
Definition: hermon.h:541
pseudo_bit_t gpio[0x00001]
Definition: hermon.h:208
userptr_t icm
ICM area.
Definition: hermon.h:881
pseudo_bit_t reserved10[0x00020]
Definition: hermon.h:408
struct hermonprm_rc_send_wqe rc
Definition: hermon.h:652
struct hermonprm_wqe_segment_ctrl_send ctrl
Definition: hermon.h:497
uint64_t offset
Offset (virtual address within ICM)
Definition: hermon.h:604
struct hermonprm_event_queue_entry generic
Definition: hermon.h:530
pseudo_bit_t srq_last_wqe[0x00001]
Definition: hermon.h:206
struct hermonprm_wqe_segment_ctrl_send ctrl
Definition: hermon.h:649
size_t wqe_size
Size of work queue.
Definition: hermon.h:688
pseudo_bit_t system_image_guid_h[0x00020]
Definition: hermon.h:247
pseudo_bit_t reserved21[0x00020]
Definition: hermon.h:300
void * wqe
Work queue buffer.
Definition: hermon.h:727
pseudo_bit_t reserved8[0x00020]
Definition: hermon.h:274
pseudo_bit_t reserved1[0x00006]
Definition: hermon.h:380
pseudo_bit_t ng[0x00001]
Definition: hermon.h:234
pseudo_bit_t reserved0[0x0000f]
Definition: hermon.h:414
struct hermonprm_port_state_change_st data
Definition: hermon.h:216
pseudo_bit_t pfcrx[0x00008]
Definition: hermon.h:369
pseudo_bit_t reserved10[0x000c0]
Definition: hermon.h:351
An Infiniband Global Route Header.
Definition: ib_packet.h:89
struct hermonprm_wqe_segment_ctrl_send ctrl
Definition: hermon.h:509
pseudo_bit_t reserved6[0x00008]
Definition: hermon.h:393
pseudo_bit_t sig[0x00001]
Definition: hermon.h:235
pseudo_bit_t reserved6[0x00010]
Definition: hermon.h:332
pseudo_bit_t reserved3[0x00004]
Definition: hermon.h:324
pseudo_bit_t egress_sniff_mode[0x00002]
Definition: hermon.h:260
struct hermon_port_type * type
Port type.
Definition: hermon.h:836
A Hermon receive work queue.
Definition: hermon.h:684
pseudo_bit_t max_gid[0x00010]
Definition: hermon.h:267
pseudo_bit_t portnum[0x00008]
Definition: hermon.h:431
struct hermonprm_scalar_parameter mtt_base_addr
Definition: hermon.h:489
struct hermonprm_completion_with_error error
Definition: hermon.h:526
pseudo_bit_t v[0x00001]
Definition: hermon.h:415
pseudo_bit_t cmd[0x00003]
Definition: hermon.h:164
pseudo_bit_t port_type[0x00002]
Definition: hermon.h:222
uint8_t force_align[HERMON_SEND_WQE_ALIGN]
Definition: hermon.h:654
pseudo_bit_t v_pprx[0x00001]
Definition: hermon.h:356
Non-volatile stored options.
pseudo_bit_t cmd_sn[0x00002]
Definition: hermon.h:166
A block of non-volatile stored options.
Definition: nvo.h:22
unsigned int reserved_qps
Number of reserved QPs.
Definition: hermon.h:563
#define HERMON_RECV_WQE_ALIGN
Alignment of Hermon receive work queue entries.
Definition: hermon.h:675
pseudo_bit_t reserved19[0x00020]
Definition: hermon.h:296
pseudo_bit_t value_hi[0x00020]
Definition: hermon.h:182
struct hermon_event_queue eq
Event queue.
Definition: hermon.h:884
pseudo_bit_t ib_link_speed[0x00004]
Definition: hermon.h:325
#define HERMON_MAX_GATHER
Definition: hermon.h:494
unsigned int num_pages
Number of pages.
Definition: hermon.h:637
pseudo_bit_t intra_miss[0x00001]
Definition: hermon.h:391
unsigned int reserved_mtts
Number of reserved MTTs.
Definition: hermon.h:583
A PCI device.
Definition: pci.h:187
struct pci_device * pci
PCI device.
Definition: hermon.h:844
pseudo_bit_t transceiver_code_lo[0x00020]
Definition: hermon.h:349
pseudo_bit_t reserved14[0x00020]
Definition: hermon.h:286
size_t firmware_len
Firmware size.
Definition: hermon.h:861
size_t icm_len
ICM size.
Definition: hermon.h:872
Definition: hermon.h:529
A network device.
Definition: netdevice.h:348
pseudo_bit_t mac_h[0x00010]
Definition: hermon.h:413
pseudo_bit_t ingress_sniff_qpn[0x00018]
Definition: hermon.h:263
#define HERMON_MAX_PORTS
Definition: hermon.h:27
A BOFM device.
Definition: bofm.h:286
pseudo_bit_t reserved0[0x00020]
Definition: hermon.h:188
size_t len
Length.
Definition: hermon.h:606
union hermon_send_wqe * wqe
Work queue entries.
Definition: hermon.h:667
An Infiniband Completion Queue.
Definition: infiniband.h:224
struct ib_queue_pair * eth_qp
Ethernet queue pair.
Definition: hermon.h:834
#define HERMON_MAX_SCATTER
Definition: hermon.h:518
void * uar
PCI user Access Region.
Definition: hermon.h:848
pseudo_bit_t lss[0x00001]
Definition: hermon.h:242
struct hermonprm_wqe_segment_data_ptr data[HERMON_MAX_SCATTER]
Definition: hermon.h:521
pseudo_bit_t vlan_id[0x0000c]
Definition: hermon.h:422
unsigned char uint8_t
Definition: stdint.h:10
pseudo_bit_t transceiver_code_hi[0x00020]
Definition: hermon.h:347
pseudo_bit_t mac_47_32[0x00010]
Definition: hermon.h:336
struct hermonprm_wqe_segment_ud ud
Definition: hermon.h:498
pseudo_bit_t internal_error[0x00001]
Definition: hermon.h:198
unsigned int reserved_eqs
Number of reserved EQs.
Definition: hermon.h:579
pseudo_bit_t xnum[0x00004]
Definition: hermon.h:432
int dpdp
Dual-port different protocol.
Definition: hermon.h:595
pseudo_bit_t max_vl_ib[0x00004]
Definition: hermon.h:328
pseudo_bit_t reserved22[0x00020]
Definition: hermon.h:302
pseudo_bit_t clientreregister[0x00001]
Definition: hermon.h:209
size_t icm_aux_len
ICM AUX size.
Definition: hermon.h:874
struct hermon_dev_cap cap
Device capabilities.
Definition: hermon.h:899
size_t eqc_entry_size
EQ context entry size.
Definition: hermon.h:581
size_t wqe_size
Size of work queue.
Definition: hermon.h:669
struct hermonprm_mtt mtt
Definition: hermon.h:491
pseudo_bit_t max_pkey[0x00010]
Definition: hermon.h:268
pseudo_bit_t reserved8[0x00007]
Definition: hermon.h:400
pseudo_bit_t v_mtu[0x00001]
Definition: hermon.h:355
pseudo_bit_t reserved23[0x00018]
Definition: hermon.h:306
unsigned int uint32_t
Definition: stdint.h:12
struct hermonprm_port_state_change_event port_state_change
Definition: hermon.h:531
pseudo_bit_t eth_link_speed[0x00004]
Definition: hermon.h:323
pseudo_bit_t reserved2[0x00002]
Definition: hermon.h:167
pseudo_bit_t wq_access_violation[0x00001]
Definition: hermon.h:204
pseudo_bit_t reserved10[0x00020]
Definition: hermon.h:278
struct hermon_port port[HERMON_MAX_PORTS]
Ports.
Definition: hermon.h:909
pseudo_bit_t offset[0x00008]
Definition: hermon.h:430
pseudo_bit_t reserved4[0x00006]
Definition: hermon.h:261
pseudo_bit_t reserved1[0x00010]
Definition: hermon.h:361
pseudo_bit_t linkspeed[0x00003]
Definition: hermon.h:433
pseudo_bit_t mac_31_0[0x00020]
Definition: hermon.h:339
#define HERMON_MAX_CQS
Maximum number of allocatable completion queues.
Definition: hermon.h:744
pseudo_bit_t reserved4[0x00010]
Definition: hermon.h:368
An Infiniband Queue Pair.
Definition: infiniband.h:157
struct hermonprm_mlx_send_wqe mlx
Definition: hermon.h:651
pseudo_bit_t reserved0[0x00012]
Definition: hermon.h:423
void * config
PCI configuration registers.
Definition: hermon.h:846
pseudo_bit_t reserved5[0x00006]
Definition: hermon.h:265
pseudo_bit_t reserved0[0x00008]
Definition: hermon.h:377
unsigned int toggle
Command toggle.
Definition: hermon.h:851
struct hermonprm_wqe_segment_data_ptr data[HERMON_MAX_GATHER]
Definition: hermon.h:499
pseudo_bit_t pptx[0x00001]
Definition: hermon.h:366
Hermon device capabilitiess.
Definition: hermon.h:559
pseudo_bit_t reserved4[0x00018]
Definition: hermon.h:387
pseudo_bit_t reserved3[0x00003]
Definition: hermon.h:243
unsigned long qpn_base
QPN base.
Definition: hermon.h:903
pseudo_bit_t guid0_l[0x00020]
Definition: hermon.h:253
void * doorbell
Doorbell register.
Definition: hermon.h:777
void(* state_change)(struct hermon *hermon, struct hermon_port *port, int link_up)
Port state changed.
Definition: hermon.h:813
size_t srqc_entry_size
SRQ context entry size.
Definition: hermon.h:573
pseudo_bit_t reserved[0x00004]
Definition: hermon.h:435
pseudo_bit_t mtu[0x00010]
Definition: hermon.h:360
pseudo_bit_t v[0x00001]
Definition: hermon.h:425
#define HERMON_BITMASK_SIZE(max_entries)
Size of a hermon resource bitmask.
Definition: hermon.h:790
pseudo_bit_t wavelength[0x00010]
Definition: hermon.h:345
pseudo_bit_t reserved0[0x00002]
Definition: hermon.h:229
struct hermon_icm_map icm_map[HERMON_ICM_NUM_REGIONS]
ICM map.
Definition: hermon.h:870
#define HERMON_MAX_MTTS
Maximum number of allocatable MTT entries.
Definition: hermon.h:630
pseudo_bit_t qn[0x00018]
Definition: hermon.h:172
pseudo_bit_t node_guid_l[0x00020]
Definition: hermon.h:257
pseudo_bit_t guid0_h[0x00020]
Definition: hermon.h:251
struct hermonprm_cq_db_record * doorbell
Doorbell record.
Definition: hermon.h:755
pseudo_bit_t mac_l[0x00020]
Definition: hermon.h:417
pseudo_bit_t mmc[0x00001]
Definition: hermon.h:239
union hermonprm_completion_entry * cqe
Completion queue entries.
Definition: hermon.h:749
Infiniband packet format.
unsigned int page_offset
Offset within page.
Definition: hermon.h:641
struct hermon_mtt mtt
MTT descriptor.
Definition: hermon.h:731
A Hermon port.
Definition: hermon.h:826
struct hermonprm_set_port_mac_table mac_table[128]
Definition: hermon.h:549
pseudo_bit_t reserved7[0x00020]
Definition: hermon.h:272
hermon_bitmask_t mtt_inuse[HERMON_BITMASK_SIZE(HERMON_MAX_MTTS)]
MTT entry in-use bitmask.
Definition: hermon.h:896
A Hermon receive work queue entry.
Definition: hermon.h:678
pseudo_bit_t hash[0x00010]
Definition: hermon.h:150
pseudo_bit_t capability_mask[0x00020]
Definition: hermon.h:245
struct hermonprm_ud_send_wqe ud
Definition: hermon.h:650
struct hermonprm_completion_queue_entry normal
Definition: hermon.h:525
pseudo_bit_t mc_promisc_mode[0x00002]
Definition: hermon.h:406
pseudo_bit_t eth[0x00001]
Definition: hermon.h:315
struct nvo_block nvo
Non-volatile option storage.
Definition: hermon.h:838
pseudo_bit_t reserved2[0x00010]
Definition: hermon.h:363
pseudo_bit_t reserved1[0x00004]
Definition: hermon.h:231
pseudo_bit_t vlan_miss_index[0x00007]
Definition: hermon.h:389
hermon_bitmask_t qp_inuse[HERMON_BITMASK_SIZE(HERMON_MAX_QPS)]
Queue pair in-use bitmask.
Definition: hermon.h:894
pseudo_bit_t reserved2[0x00004]
Definition: hermon.h:322
A management datagram.
Definition: ib_mad.h:610
pseudo_bit_t n_m[0x00004]
Definition: hermon.h:383
size_t dmpt_entry_size
DMPT entry size.
Definition: hermon.h:589
pseudo_bit_t path_migration_failed[0x00001]
Definition: hermon.h:197
pseudo_bit_t reserved2[0x00004]
Definition: hermon.h:240
pseudo_bit_t port_state_change[0x00001]
Definition: hermon.h:199
pseudo_bit_t intra_no_vlan[0x00001]
Definition: hermon.h:394
A Hermon device.
Definition: hermon.h:842
pseudo_bit_t path_migration_succeeded[0x00001]
Definition: hermon.h:191
pseudo_bit_t mp[0x00001]
Definition: hermon.h:237
A Hermon send work queue.
Definition: hermon.h:658
struct nvs_vpd_device nvsvpd
Non-volatile storage in PCI VPD.
Definition: hermon.h:906
size_t cmpt_entry_size
CMPT entry size.
Definition: hermon.h:561
A Hermon queue pair.
Definition: hermon.h:725
pseudo_bit_t base_qpn[0x00018]
Definition: hermon.h:376
unsigned long lkey
Unrestricted LKey.
Definition: hermon.h:889
pseudo_bit_t reserved1[0x0001e]
Definition: hermon.h:223
pseudo_bit_t update_ci[0x00018]
Definition: hermon.h:160
unsigned long next_idx
Next event queue entry index.
Definition: hermon.h:775
A Hermon MTT descriptor.
Definition: hermon.h:633
union ib_mad mad
Definition: hermon.h:542
struct hermonprm_set_port_ib ib
Definition: hermon.h:546
pseudo_bit_t reserved6[0x00020]
Definition: hermon.h:270
unsigned int reserved_uars
Number of reserved UARs.
Definition: hermon.h:591
uint8_t headers[IB_MAX_HEADER_SIZE]
Definition: hermon.h:505
pseudo_bit_t ib_port_width[0x00004]
Definition: hermon.h:321
pseudo_bit_t reserved1[0x00005]
Definition: hermon.h:316
pseudo_bit_t link_width_supported[0x00004]
Definition: hermon.h:304
struct hermonprm_set_port_vlan vlan
Definition: hermon.h:550
pseudo_bit_t n_v[0x00003]
Definition: hermon.h:381
unsigned int reserved_mrws
Number of reserved MRWs.
Definition: hermon.h:587
unsigned long eqn
Event queue number.
Definition: hermon.h:773
pseudo_bit_t promisc_qpn[0x00018]
Definition: hermon.h:399
pseudo_bit_t send_queue_drained[0x00001]
Definition: hermon.h:193
pseudo_bit_t a[0x00001]
Definition: hermon.h:178
Definition: hermon.h:154
size_t altc_entry_size
Alternate path context entry size.
Definition: hermon.h:567
uint8_t force_align[HERMON_RECV_WQE_ALIGN]
Definition: hermon.h:680
int(* register_dev)(struct hermon *hermon, struct hermon_port *port)
Register port.
Definition: hermon.h:805
pseudo_bit_t link_state[0x00001]
Definition: hermon.h:317
pseudo_bit_t log_max_pkey[0x00004]
Definition: hermon.h:319
unsigned int open_count
Device open request counter.
Definition: hermon.h:858
pseudo_bit_t def_mcast_qpn[0x00018]
Definition: hermon.h:403
#define HERMON_MAX_QPS
Maximum number of allocatable queue pairs.
Definition: hermon.h:711
unsigned long int dword
Definition: smc9000.h:40
#define IB_MAX_HEADER_SIZE
Maximum size required for IB headers.
Definition: ib_packet.h:156
pseudo_bit_t en_uc_promisc[0x00001]
Definition: hermon.h:401
pseudo_bit_t ib[0x00001]
Definition: hermon.h:314
size_t qpc_entry_size
QP context entry size.
Definition: hermon.h:565
unsigned int reserved_srqs
Number of reserved SRQs.
Definition: hermon.h:571
unsigned int num_wqes
Number of work queue entries, including headroom.
Definition: hermon.h:665
pseudo_bit_t reserved4[0x00004]
Definition: hermon.h:326
struct ib_global_route_header * grh
GRH buffers (if applicable)
Definition: hermon.h:690
unsigned long userptr_t
A pointer to a user buffer.
Definition: uaccess.h:33
pseudo_bit_t log_max_vlan[0x00004]
Definition: hermon.h:331
pseudo_bit_t communication_established[0x00001]
Definition: hermon.h:192
size_t grh_size
Size of GRH buffers.
Definition: hermon.h:692
A Hermon event queue.
Definition: hermon.h:765
pseudo_bit_t reserved1[0x00001]
Definition: hermon.h:165
pseudo_bit_t reserved0[0x00008]
Definition: hermon.h:161