Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

staging: lustre: lnet: change lnet_counter_t to proper structure



Change lnet_counter_t from typedef to proper structure.

Signed-off-by: default avatarJames Simmons <uja.ornl@yahoo.com>
Reviewed-on: https://review.whamcloud.com/20831


Reviewed-by: default avatarOlaf Weber <olaf@sgi.com>
Reviewed-by: default avatarDoug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: default avatarDmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: default avatarOleg Drokin <oleg.drokin@intel.com>
Signed-off-by: default avatarJames Simmons <jsimmons@infradead.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 79d2c25c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -603,7 +603,7 @@ bool lnet_delay_rule_match_locked(struct lnet_hdr *hdr, struct lnet_msg *msg);

/** @} lnet_fault_simulation */

void lnet_counters_get(lnet_counters_t *counters);
void lnet_counters_get(struct lnet_counters *counters);
void lnet_counters_reset(void);

unsigned int lnet_iov_nob(unsigned int niov, struct kvec *iov);
+1 −1
Original line number Diff line number Diff line
@@ -573,7 +573,7 @@ struct lnet {
	struct cfs_percpt_lock		 *ln_net_lock;
	/* percpt message containers for active/finalizing/freed message */
	struct lnet_msg_container	**ln_msg_containers;
	lnet_counters_t			**ln_counters;
	struct lnet_counters		**ln_counters;
	struct lnet_peer_table		**ln_peer_tables;
	/* failure simulation */
	struct list_head		  ln_test_peers;
+2 −2
Original line number Diff line number Diff line
@@ -250,7 +250,7 @@ struct lnet_ping_info {
	struct lnet_ni_status	pi_ni[0];
} WIRE_ATTR;

typedef struct lnet_counters {
struct lnet_counters {
	__u32	msgs_alloc;
	__u32	msgs_max;
	__u32	errors;
@@ -262,7 +262,7 @@ typedef struct lnet_counters {
	__u64	recv_length;
	__u64	route_length;
	__u64	drop_length;
} WIRE_ATTR lnet_counters_t;
} WIRE_ATTR;

#define LNET_NI_STATUS_UP      0x15aac0de
#define LNET_NI_STATUS_DOWN    0xdeadface
+5 −5
Original line number Diff line number Diff line
@@ -315,9 +315,9 @@ lnet_unregister_lnd(struct lnet_lnd *lnd)
EXPORT_SYMBOL(lnet_unregister_lnd);

void
lnet_counters_get(lnet_counters_t *counters)
lnet_counters_get(struct lnet_counters *counters)
{
	lnet_counters_t *ctr;
	struct lnet_counters *ctr;
	int i;

	memset(counters, 0, sizeof(*counters));
@@ -344,13 +344,13 @@ EXPORT_SYMBOL(lnet_counters_get);
void
lnet_counters_reset(void)
{
	lnet_counters_t *counters;
	struct lnet_counters *counters;
	int i;

	lnet_net_lock(LNET_LOCK_EX);

	cfs_percpt_for_each(counters, i, the_lnet.ln_counters)
		memset(counters, 0, sizeof(lnet_counters_t));
		memset(counters, 0, sizeof(struct lnet_counters));

	lnet_net_unlock(LNET_LOCK_EX);
}
@@ -560,7 +560,7 @@ lnet_prepare(lnet_pid_t requested_pid)
	the_lnet.ln_interface_cookie = ktime_get_ns();

	the_lnet.ln_counters = cfs_percpt_alloc(lnet_cpt_table(),
						sizeof(lnet_counters_t));
						sizeof(struct lnet_counters));
	if (!the_lnet.ln_counters) {
		CERROR("Failed to allocate counters for LNet\n");
		rc = -ENOMEM;
+3 −3
Original line number Diff line number Diff line
@@ -132,7 +132,7 @@ void
lnet_msg_commit(struct lnet_msg *msg, int cpt)
{
	struct lnet_msg_container *container = the_lnet.ln_msg_containers[cpt];
	lnet_counters_t *counters  = the_lnet.ln_counters[cpt];
	struct lnet_counters *counters  = the_lnet.ln_counters[cpt];

	/* routed message can be committed for both receiving and sending */
	LASSERT(!msg->msg_tx_committed);
@@ -164,7 +164,7 @@ lnet_msg_commit(struct lnet_msg *msg, int cpt)
static void
lnet_msg_decommit_tx(struct lnet_msg *msg, int status)
{
	lnet_counters_t	*counters;
	struct lnet_counters	*counters;
	lnet_event_t *ev = &msg->msg_ev;

	LASSERT(msg->msg_tx_committed);
@@ -216,7 +216,7 @@ lnet_msg_decommit_tx(struct lnet_msg *msg, int status)
static void
lnet_msg_decommit_rx(struct lnet_msg *msg, int status)
{
	lnet_counters_t *counters;
	struct lnet_counters *counters;
	lnet_event_t *ev = &msg->msg_ev;

	LASSERT(!msg->msg_tx_committed); /* decommitted or never committed */
Loading