/* ready for pending on RX delay list */
unsigned int msg_rx_ready_delay:1;
- unsigned int msg_vmflush:1; /* VM trying to free memory */
- unsigned int msg_target_is_router:1; /* sending to a router */
- unsigned int msg_routing:1; /* being forwarded */
- unsigned int msg_ack:1; /* ack on finalize (PUT) */
- unsigned int msg_sending:1; /* outgoing message */
- unsigned int msg_receiving:1; /* being received */
- unsigned int msg_txcredit:1; /* taken an NI send credit */
- unsigned int msg_peertxcredit:1; /* taken a peer send credit */
- unsigned int msg_rtrcredit:1; /* taken a globel router credit */
- unsigned int msg_peerrtrcredit:1; /* taken a peer router credit */
- unsigned int msg_onactivelist:1; /* on the activelist */
+ unsigned int msg_vmflush:1; /* VM trying to free memory */
+ unsigned int msg_target_is_router:1; /* sending to a router */
+ unsigned int msg_routing:1; /* being forwarded */
+ unsigned int msg_ack:1; /* ack on finalize (PUT) */
+ unsigned int msg_sending:1; /* outgoing message */
+ unsigned int msg_receiving:1; /* being received */
+ unsigned int msg_txcredit:1; /* taken an NI send credit */
+ unsigned int msg_peertxcredit:1; /* taken a peer send credit */
+ unsigned int msg_rtrcredit:1; /* taken a globel router credit */
+ unsigned int msg_peerrtrcredit:1; /* taken a peer router credit */
+ unsigned int msg_onactivelist:1; /* on the activelist */
unsigned int msg_rdma_get:1;
- struct lnet_peer *msg_txpeer; /* peer I'm sending to */
- struct lnet_peer *msg_rxpeer; /* peer I received from */
+ struct lnet_peer *msg_txpeer; /* peer I'm sending to */
+ struct lnet_peer *msg_rxpeer; /* peer I received from */
- void *msg_private;
- struct lnet_libmd *msg_md;
+ void *msg_private;
+ struct lnet_libmd *msg_md;
- unsigned int msg_len;
- unsigned int msg_wanted;
- unsigned int msg_offset;
- unsigned int msg_niov;
+ unsigned int msg_len;
+ unsigned int msg_wanted;
+ unsigned int msg_offset;
+ unsigned int msg_niov;
struct kvec *msg_iov;
- lnet_kiov_t *msg_kiov;
+ lnet_kiov_t *msg_kiov;
- lnet_event_t msg_ev;
- lnet_hdr_t msg_hdr;
+ lnet_event_t msg_ev;
+ lnet_hdr_t msg_hdr;
} lnet_msg_t;
} lnet_libhandle_t;
#define lh_entry(ptr, type, member) \
- ((type *)((char *)(ptr)-(char *)(&((type *)0)->member)))
+ ((type *)((char *)(ptr)-(char *)(&((type *)0)->member)))
typedef struct lnet_eq {
struct list_head eq_list;
#define LNET_COOKIE_TYPE_BITS 2
#define LNET_COOKIE_MASK ((1ULL << LNET_COOKIE_TYPE_BITS) - 1ULL)
-struct lnet_ni; /* forward ref */
+struct lnet_ni; /* forward ref */
struct socket;
typedef struct lnet_lnd
/* fields initialized by the LND */
__u32 lnd_type;
- int (*lnd_startup) (struct lnet_ni *ni);
- void (*lnd_shutdown) (struct lnet_ni *ni);
- int (*lnd_ctl)(struct lnet_ni *ni, unsigned int cmd, void *arg);
+ int (*lnd_startup)(struct lnet_ni *ni);
+ void (*lnd_shutdown)(struct lnet_ni *ni);
+ int (*lnd_ctl)(struct lnet_ni *ni, unsigned int cmd, void *arg);
- /* In data movement APIs below, payload buffers are described as a set
- * of 'niov' fragments which are...
- * EITHER
+ /* In data movement APIs below, payload buffers are described as a set
+ * of 'niov' fragments which are...
+ * EITHER
* in virtual memory (struct kvec *iov != NULL)
- * OR
- * in pages (kernel only: plt_kiov_t *kiov != NULL).
- * The LND may NOT overwrite these fragment descriptors.
- * An 'offset' and may specify a byte offset within the set of
- * fragments to start from
- */
-
- /* Start sending a preformatted message. 'private' is NULL for PUT and
- * GET messages; otherwise this is a response to an incoming message
- * and 'private' is the 'private' passed to lnet_parse(). Return
- * non-zero for immediate failure, otherwise complete later with
- * lnet_finalize() */
- int (*lnd_send)(struct lnet_ni *ni, void *private, lnet_msg_t *msg);
-
- /* Start receiving 'mlen' bytes of payload data, skipping the following
- * 'rlen' - 'mlen' bytes. 'private' is the 'private' passed to
- * lnet_parse(). Return non-zero for immedaite failure, otherwise
- * complete later with lnet_finalize(). This also gives back a receive
- * credit if the LND does flow control. */
- int (*lnd_recv)(struct lnet_ni *ni, void *private, lnet_msg_t *msg,
- int delayed, unsigned int niov,
+ * OR
+ * in pages (kernel only: plt_kiov_t *kiov != NULL).
+ * The LND may NOT overwrite these fragment descriptors.
+ * An 'offset' and may specify a byte offset within the set of
+ * fragments to start from
+ */
+
+ /* Start sending a preformatted message. 'private' is NULL for PUT and
+ * GET messages; otherwise this is a response to an incoming message
+ * and 'private' is the 'private' passed to lnet_parse(). Return
+ * non-zero for immediate failure, otherwise complete later with
+ * lnet_finalize() */
+ int (*lnd_send)(struct lnet_ni *ni, void *private, lnet_msg_t *msg);
+
+ /* Start receiving 'mlen' bytes of payload data, skipping the following
+ * 'rlen' - 'mlen' bytes. 'private' is the 'private' passed to
+ * lnet_parse(). Return non-zero for immedaite failure, otherwise
+ * complete later with lnet_finalize(). This also gives back a receive
+ * credit if the LND does flow control. */
+ int (*lnd_recv)(struct lnet_ni *ni, void *private, lnet_msg_t *msg,
+ int delayed, unsigned int niov,
struct kvec *iov, lnet_kiov_t *kiov,
- unsigned int offset, unsigned int mlen, unsigned int rlen);
+ unsigned int offset, unsigned int mlen, unsigned int rlen);
- /* lnet_parse() has had to delay processing of this message
- * (e.g. waiting for a forwarding buffer or send credits). Give the
- * LND a chance to free urgently needed resources. If called, return 0
- * for success and do NOT give back a receive credit; that has to wait
- * until lnd_recv() gets called. On failure return < 0 and
- * release resources; lnd_recv() will not be called. */
- int (*lnd_eager_recv)(struct lnet_ni *ni, void *private, lnet_msg_t *msg,
- void **new_privatep);
+ /* lnet_parse() has had to delay processing of this message
+ * (e.g. waiting for a forwarding buffer or send credits). Give the
+ * LND a chance to free urgently needed resources. If called, return 0
+ * for success and do NOT give back a receive credit; that has to wait
+ * until lnd_recv() gets called. On failure return < 0 and
+ * release resources; lnd_recv() will not be called. */
+ int (*lnd_eager_recv)(struct lnet_ni *ni, void *private, lnet_msg_t *msg,
+ void **new_privatep);
- /* notification of peer health */
- void (*lnd_notify)(struct lnet_ni *ni, lnet_nid_t peer, int alive);
+ /* notification of peer health */
+ void (*lnd_notify)(struct lnet_ni *ni, lnet_nid_t peer, int alive);
- /* query of peer aliveness */
- void (*lnd_query)(struct lnet_ni *ni, lnet_nid_t peer, cfs_time_t *when);
+ /* query of peer aliveness */
+ void (*lnd_query)(struct lnet_ni *ni, lnet_nid_t peer, cfs_time_t *when);
- /* accept a new connection */
+ /* accept a new connection */
int (*lnd_accept)(struct lnet_ni *ni, struct socket *sock);
} lnd_t;
typedef struct {
- lnet_nid_t ns_nid;
- __u32 ns_status;
- __u32 ns_unused;
+ lnet_nid_t ns_nid;
+ __u32 ns_status;
+ __u32 ns_unused;
} WIRE_ATTR lnet_ni_status_t;
struct lnet_tx_queue {
#define LNET_PING_FEAT_INVAL (0) /* no feature */
#define LNET_PING_FEAT_BASE (1 << 0) /* just a ping */
#define LNET_PING_FEAT_NI_STATUS (1 << 1) /* return NI status */
-#define LNET_PING_FEAT_RTE_DISABLED (1 << 2) /* Routing enabled */
+#define LNET_PING_FEAT_RTE_DISABLED (1 << 2) /* Routing enabled */
#define LNET_PING_FEAT_MASK (LNET_PING_FEAT_BASE | \
LNET_PING_FEAT_NI_STATUS)
} lnet_peer_t;
/* peer hash size */
-#define LNET_PEER_HASH_BITS 9
-#define LNET_PEER_HASH_SIZE (1 << LNET_PEER_HASH_BITS)
+#define LNET_PEER_HASH_BITS 9
+#define LNET_PEER_HASH_SIZE (1 << LNET_PEER_HASH_BITS)
/* peer hash table */
struct lnet_peer_table {
lnet_kiov_t rb_kiov[0]; /* the buffer space */
} lnet_rtrbuf_t;
-#define LNET_PEER_HASHSIZE 503 /* prime! */
+#define LNET_PEER_HASHSIZE 503 /* prime! */
enum {
/* Didn't match anything */
/* Must be discarded */
LNET_MATCHMD_DROP = (1 << 2),
/* match and buffer is exhausted */
- LNET_MATCHMD_EXHAUSTED = (1 << 3),
+ LNET_MATCHMD_EXHAUSTED = (1 << 3),
/* match or drop */
- LNET_MATCHMD_FINISH = (LNET_MATCHMD_OK | LNET_MATCHMD_DROP),
+ LNET_MATCHMD_FINISH = (LNET_MATCHMD_OK | LNET_MATCHMD_DROP),
};
/* Options for lnet_portal_t::ptl_options */
-#define LNET_PTL_LAZY (1 << 0)
-#define LNET_PTL_MATCH_UNIQUE (1 << 1) /* unique match, for RDMA */
-#define LNET_PTL_MATCH_WILDCARD (1 << 2) /* wildcard match, request portal */
+#define LNET_PTL_LAZY (1 << 0)
+#define LNET_PTL_MATCH_UNIQUE (1 << 1) /* unique match, for RDMA */
+#define LNET_PTL_MATCH_WILDCARD (1 << 2) /* wildcard match, request portal */
/* parameter for matching operations (GET, PUT) */
struct lnet_match_info {
struct lnet_match_table {
/* reserved for upcoming patches, CPU partition ID */
unsigned int mt_cpt;
- unsigned int mt_portal; /* portal index */
+ unsigned int mt_portal; /* portal index */
/* match table is set as "enabled" if there's non-exhausted MD
* attached on mt_mhash, it's only valid for wildcard portal */
unsigned int mt_enabled;
/* bitmap to flag whether MEs on mt_hash are exhausted or not */
__u64 mt_exhausted[LNET_MT_EXHAUSTED_BMAP];
- struct list_head *mt_mhash; /* matching hash */
+ struct list_head *mt_mhash; /* matching hash */
};
/* these are only useful for wildcard portal */
/* spread rotor of incoming "PUT" */
unsigned int ptl_rotor;
/* # active entries for this portal */
- int ptl_mt_nmaps;
+ int ptl_mt_nmaps;
/* array of active entries' cpu-partition-id */
- int ptl_mt_maps[0];
+ int ptl_mt_maps[0];
} lnet_portal_t;
#define LNET_LH_HASH_BITS 12