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