Commit 4420cfd3 authored by James Simmons's avatar James Simmons Committed by Greg Kroah-Hartman
Browse files

staging: lustre: format properly all comment blocks for LNet core



In several places in the LNet core comment blocks don't follow the
linux kernel style. This patch cleans those problems up.

Signed-off-by: default avatarJames Simmons <jsimmons@infradead.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ddbc66a5
Loading
Loading
Loading
Loading
+14 −8
Original line number Diff line number Diff line
@@ -48,7 +48,8 @@

/** \defgroup lnet_init_fini Initialization and cleanup
 * The LNet must be properly initialized before any LNet calls can be made.
 * @{ */
 * @{
 */
int LNetNIInit(lnet_pid_t requested_pid);
int LNetNIFini(void);
/** @} lnet_init_fini */
@@ -71,7 +72,8 @@ int LNetNIFini(void);
 * it's an entry in the portals table of a process.
 *
 * \see LNetMEAttach
 * @{ */
 * @{
 */
int LNetGetId(unsigned int index, lnet_process_id_t *id);
int LNetDist(lnet_nid_t nid, lnet_nid_t *srcnid, __u32 *order);
void LNetSnprintHandle(char *str, int str_len, lnet_handle_any_t handle);
@@ -89,7 +91,8 @@ void LNetSnprintHandle(char *str, int str_len, lnet_handle_any_t handle);
 * incoming requests based on process ID or the match bits provided in the
 * request. MEs can be dynamically inserted into a match list by LNetMEAttach()
 * and LNetMEInsert(), and removed from its list by LNetMEUnlink().
 * @{ */
 * @{
 */
int LNetMEAttach(unsigned int      portal,
		 lnet_process_id_t match_id_in,
		 __u64		   match_bits_in,
@@ -120,7 +123,8 @@ int LNetMEUnlink(lnet_handle_me_t current_in);
 * The LNet API provides two operations to create MDs: LNetMDAttach()
 * and LNetMDBind(); one operation to unlink and release the resources
 * associated with a MD: LNetMDUnlink().
 * @{ */
 * @{
 */
int LNetMDAttach(lnet_handle_me_t  current_in,
		 lnet_md_t	   md_in,
		 lnet_unlink_t     unlink_in,
@@ -154,7 +158,8 @@ int LNetMDUnlink(lnet_handle_md_t md_in);
 * event from an EQ, and LNetEQWait() can be used to block a process until
 * an EQ has at least one event. LNetEQPoll() can be used to test or wait
 * on multiple EQs.
 * @{ */
 * @{
 */
int LNetEQAlloc(unsigned int       count_in,
		lnet_eq_handler_t  handler,
		lnet_handle_eq_t  *handle_out);
@@ -172,7 +177,8 @@ int LNetEQPoll(lnet_handle_eq_t *eventqs_in,
 *
 * The LNet API provides two data movement operations: LNetPut()
 * and LNetGet().
 * @{ */
 * @{
 */
int LNetPut(lnet_nid_t	      self,
	    lnet_handle_md_t  md_in,
	    lnet_ack_req_t    ack_req_in,
@@ -192,8 +198,8 @@ int LNetGet(lnet_nid_t self,

/** \defgroup lnet_misc Miscellaneous operations.
 * Miscellaneous operations.
 * @{ */

 * @{
 */
int LNetSetLazyPortal(int portal);
int LNetClearLazyPortal(int portal);
int LNetCtl(unsigned int cmd, void *arg);
+6 −3
Original line number Diff line number Diff line
@@ -79,7 +79,8 @@ static inline int lnet_md_exhausted(lnet_libmd_t *md)

static inline int lnet_md_unlinkable(lnet_libmd_t *md)
{
	/* Should unlink md when its refcount is 0 and either:
	/*
	 * Should unlink md when its refcount is 0 and either:
	 *  - md has been flagged for deletion (by auto unlink or
	 *    LNetM[DE]Unlink, in the latter case md may not be exhausted).
	 *  - auto unlink is on and md is exhausted.
@@ -102,8 +103,10 @@ lnet_cpt_of_cookie(__u64 cookie)
{
	unsigned int cpt = (cookie >> LNET_COOKIE_TYPE_BITS) & LNET_CPT_MASK;

	/* LNET_CPT_NUMBER doesn't have to be power2, which means we can
	 * get illegal cpt from it's invalid cookie */
	/*
	 * LNET_CPT_NUMBER doesn't have to be power2, which means we can
	 * get illegal cpt from it's invalid cookie
	 */
	return cpt < LNET_CPT_NUMBER ? cpt : cpt % LNET_CPT_NUMBER;
}

+35 −19
Original line number Diff line number Diff line
@@ -85,8 +85,7 @@ typedef struct lnet_msg {
	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 global
						   router credit */
	unsigned int	msg_rtrcredit:1;	/* taken a global router credit */
	unsigned int	msg_peerrtrcredit:1;	/* taken a peer router credit */
	unsigned int	msg_onactivelist:1;	/* on the activelist */

@@ -190,7 +189,8 @@ typedef struct lnet_lnd {
	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
	/*
	 * In data movement APIs below, payload buffers are described as a set
	 * of 'niov' fragments which are...
	 * EITHER
	 *    in virtual memory (struct iovec *iov != NULL)
@@ -201,30 +201,36 @@ typedef struct lnet_lnd {
	 * fragments to start from
	 */

	/* Start sending a preformatted message.  'private' is NULL for PUT and
	/*
	 * 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() */
	 * 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
	/*
	 * 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 immediate failure, otherwise
	 * complete later with lnet_finalize().  This also gives back a receive
	 * credit if the LND does flow control. */
	 * 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);

	/* lnet_parse() has had to delay processing of this message
	/*
	 * 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. */
	 * 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);

@@ -272,8 +278,10 @@ typedef struct lnet_ni {

#define LNET_PROTO_PING_MATCHBITS	0x8000000000000000LL

/* NB: value of these features equal to LNET_PROTO_PING_VERSION_x
 * of old LNet, so there shouldn't be any compatibility issue */
/*
 * NB: value of these features equal to LNET_PROTO_PING_VERSION_x
 * of old LNet, so there shouldn't be any compatibility issue
 */
#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 */
@@ -347,8 +355,10 @@ struct lnet_peer_table {
	struct list_head	*pt_hash;	/* NID->peer hash */
};

/* peer aliveness is enabled only on routers for peers in a network where the
 * lnet_ni_t::ni_peertimeout has been set to a positive value */
/*
 * peer aliveness is enabled only on routers for peers in a network where the
 * lnet_ni_t::ni_peertimeout has been set to a positive value
 */
#define lnet_peer_aliveness_enabled(lp) (the_lnet.ln_routing != 0 && \
					 (lp)->lp_ni->ni_peertimeout > 0)

@@ -433,12 +443,16 @@ struct lnet_match_info {
#define LNET_MT_HASH_BITS		8
#define LNET_MT_HASH_SIZE		(1 << LNET_MT_HASH_BITS)
#define LNET_MT_HASH_MASK		(LNET_MT_HASH_SIZE - 1)
/* we allocate (LNET_MT_HASH_SIZE + 1) entries for lnet_match_table::mt_hash,
 * the last entry is reserved for MEs with ignore-bits */
/*
 * we allocate (LNET_MT_HASH_SIZE + 1) entries for lnet_match_table::mt_hash,
 * the last entry is reserved for MEs with ignore-bits
 */
#define LNET_MT_HASH_IGNORE		LNET_MT_HASH_SIZE
/* __u64 has 2^6 bits, so need 2^(LNET_MT_HASH_BITS - LNET_MT_BITS_U64) which
/*
 * __u64 has 2^6 bits, so need 2^(LNET_MT_HASH_BITS - LNET_MT_BITS_U64) which
 * is 4 __u64s as bit-map, and add an extra __u64 (only use one bit) for the
 * ME-list with ignore-bits, which is mtable::mt_hash[LNET_MT_HASH_IGNORE] */
 * ME-list with ignore-bits, which is mtable::mt_hash[LNET_MT_HASH_IGNORE]
 */
#define LNET_MT_BITS_U64		6	/* 2^6 bits */
#define LNET_MT_EXHAUSTED_BITS		(LNET_MT_HASH_BITS - LNET_MT_BITS_U64)
#define LNET_MT_EXHAUSTED_BMAP		((1 << LNET_MT_EXHAUSTED_BITS) + 1)
@@ -448,8 +462,10 @@ struct lnet_match_table {
	/* reserved for upcoming patches, CPU partition ID */
	unsigned int		 mt_cpt;
	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 */
	/*
	 * 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];
+4 −2
Original line number Diff line number Diff line
@@ -34,8 +34,10 @@
 *  Lustre Network Driver types.
 */
enum {
	/* Only add to these values (i.e. don't ever change or redefine them):
	 * network addresses depend on them... */
	/*
	 * Only add to these values (i.e. don't ever change or redefine them):
	 * network addresses depend on them...
	 */
	QSWLND		= 1,
	SOCKLND		= 2,
	GMLND		= 3,
+4 −2
Original line number Diff line number Diff line
@@ -91,8 +91,10 @@ socklnd_init_msg(ksock_msg_t *msg, int type)
#define KSOCK_MSG_NOOP	0xC0	/* ksm_u empty */
#define KSOCK_MSG_LNET	0xC1	/* lnet msg */

/* We need to know this number to parse hello msg from ksocklnd in
 * other LND (usocklnd, for example) */
/*
 * We need to know this number to parse hello msg from ksocklnd in
 * other LND (usocklnd, for example)
 */
#define KSOCK_PROTO_V2	2
#define KSOCK_PROTO_V3	3

Loading