CINXE.COM

LKML: Roland Dreier: [PATCH 09/13] [RFC] ipath IB driver headers

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>LKML: Roland Dreier: [PATCH 09/13] [RFC] ipath IB driver headers</title><link href="/css/message.css" rel="stylesheet" type="text/css" /><link href="/css/wrap.css" rel="alternate stylesheet" type="text/css" title="wrap" /><link href="/css/nowrap.css" rel="stylesheet" type="text/css" title="nowrap" /><link href="/favicon.ico" rel="shortcut icon" /><script src="/js/simple-calendar.js" type="text/javascript"></script><script src="/js/styleswitcher.js" type="text/javascript"></script><link rel="alternate" type="application/rss+xml" title="lkml.org : last 100 messages" href="/rss.php" /><link rel="alternate" type="application/rss+xml" title="lkml.org : last messages by Roland Dreier" href="/groupie.php?aid=3215" /><!--Matomo--><script> var _paq = window._paq = window._paq || []; /* tracker methods like "setCustomDimension" should be called before "trackPageView" */ _paq.push(["setDoNotTrack", true]); _paq.push(["disableCookies"]); _paq.push(['trackPageView']); _paq.push(['enableLinkTracking']); (function() { var u="//m.lkml.org/"; _paq.push(['setTrackerUrl', u+'matomo.php']); _paq.push(['setSiteId', '1']); var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s); })(); </script><!--End Matomo Code--></head><body onload="es.jasper.simpleCalendar.init();" itemscope="itemscope" itemtype="http://schema.org/BlogPosting"><table border="0" cellpadding="0" cellspacing="0"><tr><td width="180" align="center"><a href="/"><img style="border:0;width:135px;height:32px" src="/images/toprowlk.gif" alt="lkml.org" /></a></td><td width="32">聽</td><td class="nb"><div><a class="nb" href="/lkml"> [lkml]</a> 聽 <a class="nb" href="/lkml/2005"> [2005]</a> 聽 <a class="nb" href="/lkml/2005/12"> [Dec]</a> 聽 <a class="nb" href="/lkml/2005/12/16"> [16]</a> 聽 <a class="nb" href="/lkml/last100"> [last100]</a> 聽 <a href="/rss.php"><img src="/images/rss-or.gif" border="0" alt="RSS Feed" /></a></div><div>Views: <a href="#" class="nowrap" onclick="setActiveStyleSheet('wrap');return false;">[wrap]</a><a href="#" class="wrap" onclick="setActiveStyleSheet('nowrap');return false;">[no wrap]</a> 聽 <a class="nb" href="/lkml/mheaders/2005/12/16/299" onclick="this.href='/lkml/headers'+'/2005/12/16/299';">[headers]</a>聽 <a href="/lkml/bounce/2005/12/16/299">[forward]</a>聽 </div></td><td width="32">聽</td></tr><tr><td valign="top"><div class="es-jasper-simpleCalendar" baseurl="/lkml/"></div><div class="threadlist">Messages in this thread</div><ul class="threadlist"><li class="root"><a href="/lkml/2005/12/16/290">First message in thread</a></li><li><a href="/lkml/2005/12/16/296">Roland Dreier</a><ul><li><a href="/lkml/2005/12/16/305">Roland Dreier</a><ul><li class="origin"><a href="/lkml/2005/12/16/295">Roland Dreier</a><ul><li><a href="/lkml/2005/12/16/295">Roland Dreier</a><ul><li><a href="/lkml/2005/12/16/302">Roland Dreier</a></li></ul></li><li><a href="/lkml/2005/12/18/89">"Paul E. McKenney"</a><ul><li><a href="/lkml/2005/12/18/92">Robert Walsh</a></li><li><a href="/lkml/2005/12/19/163">Ralph Campbell</a></li></ul></li></ul></li><li><a href="/lkml/2005/12/17/75">Andrew Morton</a><ul><li><a href="/lkml/2005/12/20/295">Robert Walsh</a></li></ul></li></ul></li></ul></li></ul><div class="threadlist">Patch in this message</div><ul class="threadlist"><li><a href="/lkml/diff/2005/12/16/299/1">Get diff 1</a></li></ul></td><td width="32" rowspan="2" class="c" valign="top"><img src="/images/icornerl.gif" width="32" height="32" alt="/" /></td><td class="c" rowspan="2" valign="top" style="padding-top: 1em"><table><tr><td><table><tr><td class="lp">Subject</td><td class="rp" itemprop="name">[PATCH 09/13] [RFC] ipath IB driver headers</td></tr><tr><td class="lp">Date</td><td class="rp" itemprop="datePublished">Fri, 16 Dec 2005 15:48:55 -0800</td></tr><tr><td class="lp">From</td><td class="rp" itemprop="author">Roland Dreier &lt;&gt;</td></tr></table></td><td></td></tr></table><pre itemprop="articleBody">Headers for ipath IB driver<br /><br />---<br /><br /> drivers/infiniband/hw/ipath/ipath_verbs.h | 527 +++++++++++++++++++++++++++++<br /> drivers/infiniband/hw/ipath/verbs_debug.h | 104 ++++++<br /> 2 files changed, 631 insertions(+), 0 deletions(-)<br /> create mode 100644 drivers/infiniband/hw/ipath/ipath_verbs.h<br /> create mode 100644 drivers/infiniband/hw/ipath/verbs_debug.h<br /><br />8b106f1a0a6cb02f702c4ef957acad1bf8225c7d<br />diff --git a/drivers/infiniband/hw/ipath/ipath_verbs.h b/drivers/infiniband/hw/ipath/ipath_verbs.h<br />new file mode 100644<br />index 0000000..4a4c65a<br />--- /dev/null<br />+++ b/drivers/infiniband/hw/ipath/ipath_verbs.h<br />&#64;&#64; -0,0 +1,527 &#64;&#64;<br />+/*<br />+ * Copyright (c) 2005. PathScale, Inc. All rights reserved.<br />+ *<br />+ * This software is available to you under a choice of one of two<br />+ * licenses. You may choose to be licensed under the terms of the GNU<br />+ * General Public License (GPL) Version 2, available from the file<br />+ * COPYING in the main directory of this source tree, or the<br />+ * OpenIB.org BSD license below:<br />+ *<br />+ * Redistribution and use in source and binary forms, with or<br />+ * without modification, are permitted provided that the following<br />+ * conditions are met:<br />+ *<br />+ * - Redistributions of source code must retain the above<br />+ * copyright notice, this list of conditions and the following<br />+ * disclaimer.<br />+ *<br />+ * - Redistributions in binary form must reproduce the above<br />+ * copyright notice, this list of conditions and the following<br />+ * disclaimer in the documentation and/or other materials<br />+ * provided with the distribution.<br />+ *<br />+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,<br />+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF<br />+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND<br />+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS<br />+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN<br />+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN<br />+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE<br />+ * SOFTWARE.<br />+ *<br />+ * Patent licenses, if any, provided herein do not apply to<br />+ * combinations of this program with other software, or any other<br />+ * product whatsoever.<br />+ *<br />+ * $Id: ipath_verbs.h 4504 2005-12-16 06:15:47Z rjwalsh $<br />+ */<br />+<br />+#ifndef IPATH_VERBS_H<br />+#define IPATH_VERBS_H<br />+<br />+#include &lt;linux/types.h&gt;<br />+#include &lt;linux/spinlock.h&gt;<br />+#include &lt;linux/kernel.h&gt;<br />+#include &lt;linux/interrupt.h&gt;<br />+#include &lt;rdma/ib_pack.h&gt;<br />+<br />+#include "ipath_kernel.h"<br />+#include "verbs_debug.h"<br />+<br />+#define CTL_IPATH_VERBS 0x70736e68 /* "spin" as a hex value, top level */<br />+#define CTL_IPATH_VERBS_FAULT 1<br />+#define CTL_IPATH_VERBS_DEBUG 2<br />+<br />+/*<br />+ * Increment this value if any changes that break userspace ABI<br />+ * compatibility are made.<br />+ */<br />+#define IPATH_UVERBS_ABI_VERSION 1<br />+<br />+/*<br />+ * Define an ib_cq_notify value that is not valid so we know when CQ<br />+ * notifications are armed.<br />+ */<br />+#define IB_CQ_NONE (IB_CQ_NEXT_COMP + 1)<br />+<br />+enum {<br />+ IB_RNR_NAK = 0x20,<br />+<br />+ IB_NAK_PSN_ERROR = 0x60,<br />+ IB_NAK_INVALID_REQUEST = 0x61,<br />+ IB_NAK_REMOTE_ACCESS_ERROR = 0x62,<br />+ IB_NAK_REMOTE_OPERATIONAL_ERROR = 0x63,<br />+ IB_NAK_INVALID_RD_REQUEST = 0x64<br />+};<br />+<br />+/* IB Performance Manager status values */<br />+enum {<br />+ IB_PMA_SAMPLE_STATUS_DONE = 0x00,<br />+ IB_PMA_SAMPLE_STATUS_STARTED = 0x01,<br />+ IB_PMA_SAMPLE_STATUS_RUNNING = 0x02<br />+};<br />+<br />+/* Mandatory IB performance counter select values. */<br />+#define IB_PMA_PORT_XMIT_DATA __constant_htons(0x0001)<br />+#define IB_PMA_PORT_RCV_DATA __constant_htons(0x0002)<br />+#define IB_PMA_PORT_XMIT_PKTS __constant_htons(0x0003)<br />+#define IB_PMA_PORT_RCV_PKTS __constant_htons(0x0004)<br />+#define IB_PMA_PORT_XMIT_WAIT __constant_htons(0x0005)<br />+<br />+struct ib_reth {<br />+ u64 vaddr;<br />+ u32 rkey;<br />+ u32 length;<br />+} __attribute__ ((packed));<br />+<br />+struct ib_atomic_eth {<br />+ u64 vaddr;<br />+ u32 rkey;<br />+ u64 swap_data;<br />+ u64 compare_data;<br />+} __attribute__ ((packed));<br />+<br />+struct ipath_other_headers {<br />+ uint32_t bth[3];<br />+ union {<br />+ struct {<br />+ uint32_t deth[2];<br />+ uint32_t imm_data;<br />+ } ud;<br />+ struct {<br />+ struct ib_reth reth;<br />+ uint32_t imm_data;<br />+ } rc;<br />+ struct {<br />+ uint32_t aeth;<br />+ uint64_t atomic_ack_eth;<br />+ } at;<br />+ uint32_t imm_data;<br />+ uint32_t aeth;<br />+ struct ib_atomic_eth atomic_eth;<br />+ } u;<br />+} __attribute__ ((packed));<br />+<br />+/*<br />+ * Note that UD packets with a GRH header are 8+40+12+8 = 68 bytes long<br />+ * (72 w/ imm_data).<br />+ * Only the first 56 bytes of the IB header will be in the<br />+ * eager header buffer. The remaining 12 or 16 bytes are in the data buffer.<br />+ */<br />+struct ipath_ib_header {<br />+ uint16_t lrh[4];<br />+ union {<br />+ struct {<br />+ struct ib_grh grh;<br />+ struct ipath_other_headers oth;<br />+ } l;<br />+ struct ipath_other_headers oth;<br />+ } u;<br />+} __attribute__ ((packed));<br />+<br />+/*<br />+ * There is one struct ipath_mcast for each multicast GID.<br />+ * All attached QPs are then stored as a list of<br />+ * struct ipath_mcast_qp.<br />+ */<br />+struct ipath_mcast_qp {<br />+ struct list_head list;<br />+ struct ipath_qp *qp;<br />+};<br />+<br />+struct ipath_mcast {<br />+ struct rb_node rb_node;<br />+ union ib_gid mgid;<br />+ struct list_head qp_list;<br />+ wait_queue_head_t wait;<br />+ atomic_t refcount;<br />+};<br />+<br />+/* Memory region */<br />+struct ipath_mr {<br />+ struct ib_mr ibmr;<br />+ struct ipath_mregion mr; /* must be last */<br />+};<br />+<br />+/* Fast memory region */<br />+struct ipath_fmr {<br />+ struct ib_fmr ibfmr;<br />+ u8 page_size;<br />+ struct ipath_mregion mr; /* must be last */<br />+};<br />+<br />+/* Protection domain */<br />+struct ipath_pd {<br />+ struct ib_pd ibpd;<br />+ int user; /* non-zero if created from user space */<br />+};<br />+<br />+/* Address Handle */<br />+struct ipath_ah {<br />+ struct ib_ah ibah;<br />+ struct ib_ah_attr attr;<br />+};<br />+<br />+/*<br />+ * Quick description of our CQ/QP locking scheme:<br />+ *<br />+ * We have one global lock that protects dev-&gt;cq/qp_table. Each<br />+ * struct ipath_cq/qp also has its own lock. An individual qp lock<br />+ * may be taken inside of an individual cq lock. Both cqs attached to<br />+ * a qp may be locked, with the send cq locked first. No other<br />+ * nesting should be done.<br />+ *<br />+ * Each struct ipath_cq/qp also has an atomic_t ref count. The<br />+ * pointer from the cq/qp_table to the struct counts as one reference.<br />+ * This reference also is good for access through the consumer API, so<br />+ * modifying the CQ/QP etc doesn't need to take another reference.<br />+ * Access because of a completion being polled does need a reference.<br />+ *<br />+ * Finally, each struct ipath_cq/qp has a wait_queue_head_t for the<br />+ * destroy function to sleep on.<br />+ *<br />+ * This means that access from the consumer API requires nothing but<br />+ * taking the struct's lock.<br />+ *<br />+ * Access because of a completion event should go as follows:<br />+ * - lock cq/qp_table and look up struct<br />+ * - increment ref count in struct<br />+ * - drop cq/qp_table lock<br />+ * - lock struct, do your thing, and unlock struct<br />+ * - decrement ref count; if zero, wake up waiters<br />+ *<br />+ * To destroy a CQ/QP, we can do the following:<br />+ * - lock cq/qp_table, remove pointer, unlock cq/qp_table lock<br />+ * - decrement ref count<br />+ * - wait_event until ref count is zero<br />+ *<br />+ * It is the consumer's responsibilty to make sure that no QP<br />+ * operations (WQE posting or state modification) are pending when the<br />+ * QP is destroyed. Also, the consumer must make sure that calls to<br />+ * qp_modify are serialized.<br />+ *<br />+ * Possible optimizations (wait for profile data to see if/where we<br />+ * have locks bouncing between CPUs):<br />+ * - split cq/qp table lock into n separate (cache-aligned) locks,<br />+ * indexed (say) by the page in the table<br />+ */<br />+<br />+struct ipath_cq {<br />+ struct ib_cq ibcq;<br />+ struct tasklet_struct comptask;<br />+ spinlock_t lock;<br />+ u8 notify;<br />+ u8 triggered;<br />+ u32 head; /* new records added to the head */<br />+ u32 tail; /* poll_cq() reads from here. */<br />+ struct ib_wc queue[1]; /* this is actually ibcq.cqe + 1 */<br />+};<br />+<br />+/*<br />+ * Send work request queue entry.<br />+ * The size of the sg_list is determined when the QP is created and stored<br />+ * in qp-&gt;s_max_sge.<br />+ */<br />+struct ipath_swqe {<br />+ struct ib_send_wr wr; /* don't use wr.sg_list */<br />+ u32 psn; /* first packet sequence number */<br />+ u32 lpsn; /* last packet sequence number */<br />+ u32 ssn; /* send sequence number */<br />+ u32 length; /* total length of data in sg_list */<br />+ struct ipath_sge sg_list[0];<br />+};<br />+<br />+/*<br />+ * Receive work request queue entry.<br />+ * The size of the sg_list is determined when the QP is created and stored<br />+ * in qp-&gt;r_max_sge.<br />+ */<br />+struct ipath_rwqe {<br />+ u64 wr_id;<br />+ u32 length; /* total length of data in sg_list */<br />+ u8 num_sge;<br />+ struct ipath_sge sg_list[0];<br />+};<br />+<br />+struct ipath_rq {<br />+ spinlock_t lock;<br />+ u32 head; /* new work requests posted to the head */<br />+ u32 tail; /* receives pull requests from here. */<br />+ u32 size; /* size of RWQE array */<br />+ u8 max_sge;<br />+ struct ipath_rwqe *wq; /* RWQE array */<br />+};<br />+<br />+struct ipath_srq {<br />+ struct ib_srq ibsrq;<br />+ struct ipath_rq rq;<br />+ u32 limit; /* send signal when number of RWQEs &lt; limit */<br />+};<br />+<br />+/*<br />+ * Variables prefixed with s_ are for the requester (sender).<br />+ * Variables prefixed with r_ are for the responder (receiver).<br />+ * Variables prefixed with ack_ are for responder replies.<br />+ *<br />+ * Common variables are protected by both r_rq.lock and s_lock in that order<br />+ * which only happens in modify_qp() or changing the QP 'state'.<br />+ */<br />+struct ipath_qp {<br />+ struct ib_qp ibqp;<br />+ struct ipath_qp *next; /* link list for QPN hash table */<br />+ struct list_head piowait; /* link for wait PIO buf */<br />+ struct list_head timerwait; /* link for waiting for timeouts */<br />+ struct ib_ah_attr remote_ah_attr;<br />+ struct ipath_ib_header s_hdr; /* next packet header to send */<br />+ atomic_t refcount;<br />+ wait_queue_head_t wait;<br />+ struct tasklet_struct s_task;<br />+ struct ipath_sge_state *s_cur_sge;<br />+ struct ipath_sge_state s_sge; /* current send request data */<br />+ struct ipath_sge_state s_rdma_sge; /* current RDMA read send data */<br />+ struct ipath_sge_state r_sge; /* current receive data */<br />+ spinlock_t s_lock;<br />+ int s_flags;<br />+ u32 s_hdrwords; /* size of s_hdr in 32 bit words */<br />+ u32 s_cur_size; /* size of send packet in bytes */<br />+ u32 s_len; /* total length of s_sge */<br />+ u32 s_rdma_len; /* total length of s_rdma_sge */<br />+ u32 s_next_psn; /* PSN for next request */<br />+ u32 s_last_psn; /* last response PSN processed */<br />+ u32 s_psn; /* current packet sequence number */<br />+ u32 s_rnr_timeout; /* number of milliseconds for RNR timeout */<br />+ u32 s_ack_psn; /* PSN for next ACK or RDMA_READ */<br />+ u64 s_ack_atomic; /* data for atomic ACK */<br />+ u64 r_wr_id; /* ID for current receive WQE */<br />+ u64 r_atomic_data; /* data for last atomic op */<br />+ u32 r_atomic_psn; /* PSN of last atomic op */<br />+ u32 r_len; /* total length of r_sge */<br />+ u32 r_rcv_len; /* receive data len processed */<br />+ u32 r_psn; /* expected rcv packet sequence number */<br />+ u8 state; /* QP state */<br />+ u8 s_state; /* opcode of last packet sent */<br />+ u8 s_ack_state; /* opcode of packet to ACK */<br />+ u8 s_nak_state; /* non-zero if NAK is pending */<br />+ u8 r_state; /* opcode of last packet received */<br />+ u8 r_reuse_sge; /* for UC receive errors */<br />+ u8 r_sge_inx; /* current index into sg_list */<br />+ u8 s_max_sge; /* size of s_wq-&gt;sg_list */<br />+ u8 qp_access_flags;<br />+ u8 s_retry_cnt; /* number of times to retry */<br />+ u8 s_rnr_retry_cnt;<br />+ u8 s_min_rnr_timer;<br />+ u8 s_retry; /* requester retry counter */<br />+ u8 s_rnr_retry; /* requester RNR retry counter */<br />+ u8 s_pkey_index; /* PKEY index to use */<br />+ enum ib_mtu path_mtu;<br />+ atomic_t msn; /* message sequence number */<br />+ u32 remote_qpn;<br />+ u32 qkey; /* QKEY for this QP (for UD or RD) */<br />+ u32 s_size; /* send work queue size */<br />+ u32 s_head; /* new entries added here */<br />+ u32 s_tail; /* next entry to process */<br />+ u32 s_cur; /* current work queue entry */<br />+ u32 s_last; /* last un-ACK'ed entry */<br />+ u32 s_ssn; /* SSN of tail entry */<br />+ u32 s_lsn; /* limit sequence number (credit) */<br />+ struct ipath_swqe *s_wq; /* send work queue */<br />+ struct ipath_rq r_rq; /* receive work queue */<br />+};<br />+<br />+/*<br />+ * Bit definitions for s_flags.<br />+ */<br />+#define IPATH_S_BUSY 0<br />+#define IPATH_S_SIGNAL_REQ_WR 1<br />+<br />+/*<br />+ * Since struct ipath_swqe is not a fixed size, we can't simply index into<br />+ * struct ipath_qp.s_wq. This function does the array index computation.<br />+ */<br />+static inline struct ipath_swqe *get_swqe_ptr(struct ipath_qp *qp, unsigned n)<br />+{<br />+ return (struct ipath_swqe *)((char *) qp-&gt;s_wq +<br />+ (sizeof(struct ipath_swqe) +<br />+ qp-&gt;s_max_sge * sizeof(struct ipath_sge)) * n);<br />+}<br />+<br />+/*<br />+ * Since struct ipath_rwqe is not a fixed size, we can't simply index into<br />+ * struct ipath_rq.wq. This function does the array index computation.<br />+ */<br />+static inline struct ipath_rwqe *get_rwqe_ptr(struct ipath_rq *rq, unsigned n)<br />+{<br />+ return (struct ipath_rwqe *)((char *) rq-&gt;wq +<br />+ (sizeof(struct ipath_rwqe) +<br />+ rq-&gt;max_sge * sizeof(struct ipath_sge)) * n);<br />+}<br />+<br />+#define QPN_MAX (1 &lt;&lt; 24)<br />+#define QPNMAP_ENTRIES (QPN_MAX / PAGE_SIZE / 8)<br />+#define BITS_PER_PAGE (PAGE_SIZE*8)<br />+#define BITS_PER_PAGE_MASK (BITS_PER_PAGE-1)<br />+#define mk_qpn(qpt, map, off) (((map) - (qpt)-&gt;map)*BITS_PER_PAGE + (off))<br />+#define find_next_offset(map, off) \<br />+ find_next_zero_bit((map)-&gt;page, BITS_PER_PAGE, off)<br />+<br />+/*<br />+ * QPN-map pages start out as NULL, they get allocated upon<br />+ * first use and are never deallocated. This way,<br />+ * large bitmaps are not allocated unless large numbers of QPs are used.<br />+ */<br />+struct qpn_map {<br />+ atomic_t n_free;<br />+ void *page;<br />+};<br />+<br />+struct ipath_qp_table {<br />+ spinlock_t lock;<br />+ u32 last; /* last QP number allocated */<br />+ u32 max; /* size of the hash table */<br />+ u32 nmaps; /* size of the map table */<br />+ struct ipath_qp **table;<br />+ struct qpn_map map[QPNMAP_ENTRIES]; /* bit map of free numbers */<br />+};<br />+<br />+struct ipath_lkey_table {<br />+ spinlock_t lock;<br />+ u32 next; /* next unused index (speeds search) */<br />+ u32 gen; /* generation count */<br />+ u32 max; /* size of the table */<br />+ struct ipath_mregion **table;<br />+};<br />+<br />+struct ipath_opcode_stats {<br />+ u64 n_packets; /* number of packets */<br />+ u64 n_bytes; /* total number of bytes */<br />+};<br />+<br />+struct ipath_ibdev {<br />+ struct ib_device ibdev;<br />+ ipath_type ib_unit; /* This is the device number */<br />+ u16 sm_lid; /* in host order */<br />+ u8 sm_sl;<br />+ u8 mkeyprot_resv_lmc;<br />+ unsigned long mkey_lease_timeout; /* non-zero when timer is set */<br />+<br />+ /* The following fields are really per port. */<br />+ struct ipath_qp_table qp_table;<br />+ struct ipath_lkey_table lk_table;<br />+ struct list_head pending[3]; /* FIFO of QPs waiting for ACKs */<br />+ struct list_head piowait; /* list for wait PIO buf */<br />+ struct list_head rnrwait; /* list of QPs waiting for RNR timer */<br />+ spinlock_t pending_lock;<br />+ __be64 sys_image_guid; /* in network order */<br />+ __be64 gid_prefix; /* in network order */<br />+ __be64 mkey;<br />+ u64 ipath_sword; /* total dwords sent (sample result) */<br />+ u64 ipath_rword; /* total dwords received (sample result) */<br />+ u64 ipath_spkts; /* total packets sent (sample result) */<br />+ u64 ipath_rpkts; /* total packets received (sample result) */<br />+ u64 n_multicast_xmit; /* total multicast packets sent */<br />+ u64 n_multicast_rcv; /* total multicast packets received */<br />+ u32 n_rc_resends;<br />+ u32 n_rc_acks;<br />+ u32 n_rc_qacks;<br />+ u32 n_seq_naks;<br />+ u32 n_rdma_seq;<br />+ u32 n_rnr_naks;<br />+ u32 n_other_naks;<br />+ u32 n_timeouts;<br />+ u32 n_pkt_drops;<br />+ u32 n_wqe_errs;<br />+ u32 n_rdma_dup_busy;<br />+ u32 n_piowait;<br />+ u32 n_no_piobuf;<br />+ u32 port_cap_flags;<br />+ u32 pma_sample_start;<br />+ u32 pma_sample_interval;<br />+ __be16 pma_counter_select[5];<br />+ u16 pma_tag;<br />+ u16 qkey_violations;<br />+ u16 mkey_violations;<br />+ u16 mkey_lease_period;<br />+ u16 pending_index; /* which pending queue is active */<br />+ u8 pma_sample_status;<br />+ u8 subnet_timeout;<br />+ struct ipath_opcode_stats opstats[128];<br />+};<br />+<br />+struct ipath_ucontext {<br />+ struct ib_ucontext ibucontext;<br />+};<br />+<br />+static inline struct ipath_mr *to_imr(struct ib_mr *ibmr)<br />+{<br />+ return container_of(ibmr, struct ipath_mr, ibmr);<br />+}<br />+<br />+static inline struct ipath_fmr *to_ifmr(struct ib_fmr *ibfmr)<br />+{<br />+ return container_of(ibfmr, struct ipath_fmr, ibfmr);<br />+}<br />+<br />+static inline struct ipath_pd *to_ipd(struct ib_pd *ibpd)<br />+{<br />+ return container_of(ibpd, struct ipath_pd, ibpd);<br />+}<br />+<br />+static inline struct ipath_ah *to_iah(struct ib_ah *ibah)<br />+{<br />+ return container_of(ibah, struct ipath_ah, ibah);<br />+}<br />+<br />+static inline struct ipath_cq *to_icq(struct ib_cq *ibcq)<br />+{<br />+ return container_of(ibcq, struct ipath_cq, ibcq);<br />+}<br />+<br />+static inline struct ipath_srq *to_isrq(struct ib_srq *ibsrq)<br />+{<br />+ return container_of(ibsrq, struct ipath_srq, ibsrq);<br />+}<br />+<br />+static inline struct ipath_qp *to_iqp(struct ib_qp *ibqp)<br />+{<br />+ return container_of(ibqp, struct ipath_qp, ibqp);<br />+}<br />+<br />+static inline struct ipath_ibdev *to_idev(struct ib_device *ibdev)<br />+{<br />+ return container_of(ibdev, struct ipath_ibdev, ibdev);<br />+}<br />+<br />+int ipath_process_mad(struct ib_device *ibdev,<br />+ int mad_flags,<br />+ u8 port_num,<br />+ struct ib_wc *in_wc,<br />+ struct ib_grh *in_grh,<br />+ struct ib_mad *in_mad, struct ib_mad *out_mad);<br />+<br />+static inline struct ipath_ucontext *to_iucontext(struct ib_ucontext<br />+ *ibucontext)<br />+{<br />+ return container_of(ibucontext, struct ipath_ucontext, ibucontext);<br />+}<br />+<br />+#endif /* IPATH_VERBS_H */<br />diff --git a/drivers/infiniband/hw/ipath/verbs_debug.h b/drivers/infiniband/hw/ipath/verbs_debug.h<br />new file mode 100644<br />index 0000000..21e0f8c<br />--- /dev/null<br />+++ b/drivers/infiniband/hw/ipath/verbs_debug.h<br />&#64;&#64; -0,0 +1,104 &#64;&#64;<br />+/*<br />+ * Copyright (c) 2003, 2004, 2005. PathScale, Inc. All rights reserved.<br />+ *<br />+ * This software is available to you under a choice of one of two<br />+ * licenses. You may choose to be licensed under the terms of the GNU<br />+ * General Public License (GPL) Version 2, available from the file<br />+ * COPYING in the main directory of this source tree, or the<br />+ * OpenIB.org BSD license below:<br />+ *<br />+ * Redistribution and use in source and binary forms, with or<br />+ * without modification, are permitted provided that the following<br />+ * conditions are met:<br />+ *<br />+ * - Redistributions of source code must retain the above<br />+ * copyright notice, this list of conditions and the following<br />+ * disclaimer.<br />+ *<br />+ * - Redistributions in binary form must reproduce the above<br />+ * copyright notice, this list of conditions and the following<br />+ * disclaimer in the documentation and/or other materials<br />+ * provided with the distribution.<br />+ *<br />+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,<br />+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF<br />+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND<br />+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS<br />+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN<br />+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN<br />+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE<br />+ * SOFTWARE.<br />+ *<br />+ * Patent licenses, if any, provided herein do not apply to<br />+ * combinations of this program with other software, or any other<br />+ * product whatsoever.<br />+ *<br />+ * $Id: verbs_debug.h 4365 2005-12-10 00:04:16Z rjwalsh $<br />+ */<br />+<br />+#ifndef _VERBS_DEBUG_H<br />+#define _VERBS_DEBUG_H<br />+<br />+/*<br />+ * This file contains tracing code for the ib_ipath kernel module.<br />+ */<br />+#ifndef _VERBS_DEBUGGING /* tracing enabled or not */<br />+#define _VERBS_DEBUGGING 1<br />+#endif<br />+<br />+extern unsigned ib_ipath_debug;<br />+<br />+#define __VERBS_ERRID "ib_ipath"<br />+#define __VERBS_UNIT_ERRID(unit) ipath_get_unit_name(unit)<br />+<br />+#define _VERBS_ERROR(fmt,...) do { \<br />+ printk (KERN_ERR "%s: " fmt, __VERBS_ERRID,##__VA_ARGS__); \<br />+ } while(0)<br />+<br />+#define _VERBS_UNIT_ERROR(unit,fmt,...) do { \<br />+ printk (KERN_ERR "%s: " fmt, __VERBS_ERRID(unit),##__VA_ARGS__); \<br />+ } while(0)<br />+<br />+#if _VERBS_DEBUGGING<br />+<br />+/*<br />+ * Mask values for debugging. The scheme allows us to compile out any of<br />+ * the debug tracing stuff, and if compiled in, to enable or disable dynamically<br />+ * This can be set at modprobe time also:<br />+ * modprobe ib_path ib_ipath_debug=3<br />+ */<br />+#define __VERBS_INFO 0x1 /* generic low verbosity stuff */<br />+#define __VERBS_DBG 0x2 /* generic debug */<br />+#define __VERBS_VDBG 0x4 /* verbose debug */<br />+#define __VERBS_SMADBG 0x8000 /* sma packet debug */<br />+<br />+#define _VERBS_INFO(fmt,...) do { \<br />+ if(unlikely(ib_ipath_debug&amp;__VERBS_INFO)) \<br />+ printk (KERN_INFO "%s: " fmt,__VERBS_ERRID,##__VA_ARGS__); \<br />+ } while(0)<br />+<br />+#define _VERBS_DBG(fmt,...) do { \<br />+ if(unlikely(ib_ipath_debug&amp;__VERBS_DBG)) \<br />+ printk (KERN_DEBUG "%s: " fmt, __func__,##__VA_ARGS__); \<br />+ } while(0)<br />+<br />+#define _VERBS_VDBG(fmt,...) do { \<br />+ if(unlikely(ib_ipath_debug&amp;__VERBS_VDBG)) \<br />+ printk (KERN_DEBUG "%s: " fmt, __func__,##__VA_ARGS__); \<br />+ } while(0)<br />+<br />+#define _VERBS_SMADBG(fmt,...) do { \<br />+ if(unlikely(ib_ipath_debug&amp;__VERBS_SMADBG)) \<br />+ printk (KERN_DEBUG "%s: " fmt, __func__,##__VA_ARGS__); \<br />+ } while(0)<br />+<br />+#else /* ! _VERBS_DEBUGGING */<br />+<br />+#define _VERBS_INFO(fmt,...)<br />+#define _VERBS_DBG(fmt,...)<br />+#define _VERBS_VDBG(fmt,...)<br />+#define _VERBS_SMADBG(fmt,...)<br />+<br />+#endif /* _VERBS_DEBUGGING */<br />+<br />+#endif /* _VERBS_DEBUG_H */<br />-- <br />0.99.9n<br />-<br />To unsubscribe from this list: send the line "unsubscribe linux-kernel" in<br />the body of a message to majordomo&#64;vger.kernel.org<br />More majordomo info at <a href="http://vger.kernel.org/majordomo-info.html">http://vger.kernel.org/majordomo-info.html</a><br />Please read the FAQ at <a href="http://www.tux.org/lkml/">http://www.tux.org/lkml/</a><br /></pre></td><td width="32" rowspan="2" class="c" valign="top"><img src="/images/icornerr.gif" width="32" height="32" alt="\" /></td></tr><tr><td align="right" valign="bottom"> 聽 </td></tr><tr><td align="right" valign="bottom">聽</td><td class="c" valign="bottom" style="padding-bottom: 0px"><img src="/images/bcornerl.gif" width="32" height="32" alt="\" /></td><td class="c">聽</td><td class="c" valign="bottom" style="padding-bottom: 0px"><img src="/images/bcornerr.gif" width="32" height="32" alt="/" /></td></tr><tr><td align="right" valign="top" colspan="2"> 聽 </td><td class="lm">Last update: 2005-12-17 00:58 聽聽 [from the cache]<br />漏2003-2020 <a href="http://blog.jasper.es/"><span itemprop="editor">Jasper Spaans</span></a>|hosted at <a href="https://www.digitalocean.com/?refcode=9a8e99d24cf9">Digital Ocean</a> and my Meterkast|<a href="http://blog.jasper.es/categories.html#lkml-ref">Read the blog</a></td><td>聽</td></tr></table><script language="javascript" src="/js/styleswitcher.js" type="text/javascript"></script></body></html>

Pages: 1 2 3 4 5 6 7 8 9 10