IB/qib: Remove qpn, qp tables and related variables from qib
[platform/kernel/linux-rpi.git] / drivers / infiniband / hw / qib / qib_verbs.h
index 00dd2ad..e10ab80 100644 (file)
@@ -55,9 +55,6 @@ struct qib_verbs_txreq;
 #define QIB_MAX_RDMA_ATOMIC     16
 #define QIB_GUIDS_PER_PORT     5
 
-#define QPN_MAX                 (1 << 24)
-#define QPNMAP_ENTRIES          (QPN_MAX / PAGE_SIZE / BITS_PER_BYTE)
-
 /*
  * Increment this value if any changes that break userspace ABI
  * compatibility are made.
@@ -364,26 +361,6 @@ static inline struct rvt_rwqe *get_rwqe_ptr(struct rvt_rq *rq, unsigned n)
                  rq->max_sge * sizeof(struct ib_sge)) * n);
 }
 
-/*
- * QPN-map pages start out as NULL, they get allocated upon
- * first use and are never deallocated. This way,
- * large bitmaps are not allocated unless large numbers of QPs are used.
- */
-struct qpn_map {
-       void *page;
-};
-
-struct qib_qpn_table {
-       spinlock_t lock; /* protect changes in this struct */
-       unsigned flags;         /* flags for QP0/1 allocated for each port */
-       u32 last;               /* last QP number allocated */
-       u32 nmaps;              /* size of the map table */
-       u16 limit;
-       u16 mask;
-       /* bit map of free QP numbers other than 0/1 */
-       struct qpn_map map[QPNMAP_ENTRIES];
-};
-
 struct qib_opcode_stats {
        u64 n_packets;          /* number of packets */
        u64 n_bytes;            /* total number of bytes */
@@ -401,21 +378,10 @@ struct qib_pma_counters {
 };
 
 struct qib_ibport {
-       struct rvt_qp __rcu *qp0;
-       struct rvt_qp __rcu *qp1;
-       struct ib_mad_agent *send_agent;        /* agent for SMI (traps) */
+       struct rvt_ibport rvp;
        struct rvt_ah *sm_ah;
        struct rvt_ah *smi_ah;
-       struct rb_root mcast_tree;
-       spinlock_t lock;                /* protect changes in this struct */
-
-       /* non-zero when timer is set */
-       unsigned long mkey_lease_timeout;
-       unsigned long trap_timeout;
-       __be64 gid_prefix;      /* in network order */
-       __be64 mkey;
        __be64 guids[QIB_GUIDS_PER_PORT - 1];   /* writable GUIDs */
-       u64 tid;                /* TID for traps */
        struct qib_pma_counters __percpu *pmastats;
        u64 z_unicast_xmit;     /* starting count for PMA */
        u64 z_unicast_rcv;      /* starting count for PMA */
@@ -434,64 +400,21 @@ struct qib_ibport {
        u32 z_local_link_integrity_errors;      /* starting count for PMA */
        u32 z_excessive_buffer_overrun_errors;  /* starting count for PMA */
        u32 z_vl15_dropped;                     /* starting count for PMA */
-       u32 n_rc_resends;
-       u32 n_rc_acks;
-       u32 n_rc_qacks;
-       u32 n_rc_delayed_comp;
-       u32 n_seq_naks;
-       u32 n_rdma_seq;
-       u32 n_rnr_naks;
-       u32 n_other_naks;
-       u32 n_loop_pkts;
-       u32 n_pkt_drops;
-       u32 n_vl15_dropped;
-       u32 n_rc_timeouts;
-       u32 n_dmawait;
-       u32 n_unaligned;
-       u32 n_rc_dupreq;
-       u32 n_rc_seqnak;
-       u32 port_cap_flags;
-       u32 pma_sample_start;
-       u32 pma_sample_interval;
-       __be16 pma_counter_select[5];
-       u16 pma_tag;
-       u16 pkey_violations;
-       u16 qkey_violations;
-       u16 mkey_violations;
-       u16 mkey_lease_period;
-       u16 sm_lid;
-       u16 repress_traps;
-       u8 sm_sl;
-       u8 mkeyprot;
-       u8 subnet_timeout;
-       u8 vl_high_limit;
        u8 sl_to_vl[16];
-
 };
 
-
 struct qib_ibdev {
        struct rvt_dev_info rdi;
-       struct list_head pending_mmaps;
-       spinlock_t mmap_offset_lock; /* protect mmap_offset */
-       u32 mmap_offset;
 
-       /* QP numbers are shared by all IB ports */
-       struct qib_qpn_table qpn_table;
        struct list_head piowait;       /* list for wait PIO buf */
        struct list_head dmawait;       /* list for wait DMA */
        struct list_head txwait;        /* list for wait qib_verbs_txreq */
        struct list_head memwait;       /* list for wait kernel memory */
        struct list_head txreq_free;
        struct timer_list mem_timer;
-       struct rvt_qp __rcu **qp_table;
        struct qib_pio_header *pio_hdrs;
        dma_addr_t pio_hdrs_phys;
-       /* list of QPs waiting for RNR timer */
-       spinlock_t pending_lock; /* protect wait lists, PMA counters, etc. */
-       u32 qp_table_size; /* size of the hash table */
        u32 qp_rnd; /* random bytes for hash */
-       spinlock_t qpt_lock;
 
        u32 n_piowait;
        u32 n_txwait;
@@ -629,9 +552,9 @@ int qib_query_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
 
 unsigned qib_free_all_qps(struct qib_devdata *dd);
 
-void qib_init_qpn_table(struct qib_devdata *dd, struct qib_qpn_table *qpt);
+void qib_init_qpn_table(struct qib_devdata *dd, struct rvt_qpn_table *qpt);
 
-void qib_free_qpn_table(struct qib_qpn_table *qpt);
+void qib_free_qpn_table(struct rvt_qpn_table *qpt);
 
 #ifdef CONFIG_DEBUG_FS
 
@@ -727,17 +650,6 @@ static inline void qib_put_ss(struct rvt_sge_state *ss)
        }
 }
 
-void qib_release_mmap_info(struct kref *ref);
-
-struct rvt_mmap_info *qib_create_mmap_info(struct qib_ibdev *dev, u32 size,
-                                          struct ib_ucontext *context,
-                                          void *obj);
-
-void qib_update_mmap_info(struct qib_ibdev *dev, struct rvt_mmap_info *ip,
-                         u32 size, void *obj);
-
-int qib_mmap(struct ib_ucontext *context, struct vm_area_struct *vma);
-
 int qib_get_rwqe(struct rvt_qp *qp, int wr_id_only);
 
 void qib_migrate_qp(struct rvt_qp *qp);