Commit 3236dd36 authored by James Simmons's avatar James Simmons Committed by Greg Kroah-Hartman

staging: lustre: lnet: change lnet_ping_info_t to proper structure

Change lnet_ping_info_t from typedef to proper structure.
Signed-off-by: default avatarJames Simmons <uja.ornl@yahoo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6142
Reviewed-on: https://review.whamcloud.com/24566Reviewed-by: default avatarDoug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: default avatarOlaf Weber <olaf@sgi.com>
Reviewed-by: default avatarAndreas Dilger <andreas.dilger@intel.com>
Reviewed-by: default avatarDmitry Eremin <dmitry.eremin@intel.com>
Signed-off-by: default avatarJames Simmons <jsimmons@infradead.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent af7e07cc
...@@ -664,7 +664,7 @@ int lnet_peer_buffer_credits(lnet_ni_t *ni); ...@@ -664,7 +664,7 @@ int lnet_peer_buffer_credits(lnet_ni_t *ni);
int lnet_router_checker_start(void); int lnet_router_checker_start(void);
void lnet_router_checker_stop(void); void lnet_router_checker_stop(void);
void lnet_router_ni_update_locked(lnet_peer_t *gw, __u32 net); void lnet_router_ni_update_locked(lnet_peer_t *gw, __u32 net);
void lnet_swap_pinginfo(lnet_ping_info_t *info); void lnet_swap_pinginfo(struct lnet_ping_info *info);
int lnet_parse_ip2nets(char **networksp, char *ip2nets); int lnet_parse_ip2nets(char **networksp, char *ip2nets);
int lnet_parse_routes(char *route_str, int *im_a_router); int lnet_parse_routes(char *route_str, int *im_a_router);
......
...@@ -295,13 +295,13 @@ typedef struct lnet_ni { ...@@ -295,13 +295,13 @@ typedef struct lnet_ni {
/* router checker data, per router */ /* router checker data, per router */
#define LNET_MAX_RTR_NIS 16 #define LNET_MAX_RTR_NIS 16
#define LNET_PINGINFO_SIZE offsetof(lnet_ping_info_t, pi_ni[LNET_MAX_RTR_NIS]) #define LNET_PINGINFO_SIZE offsetof(struct lnet_ping_info, pi_ni[LNET_MAX_RTR_NIS])
typedef struct { typedef struct {
/* chain on the_lnet.ln_zombie_rcd or ln_deathrow_rcd */ /* chain on the_lnet.ln_zombie_rcd or ln_deathrow_rcd */
struct list_head rcd_list; struct list_head rcd_list;
lnet_handle_md_t rcd_mdh; /* ping buffer MD */ lnet_handle_md_t rcd_mdh; /* ping buffer MD */
struct lnet_peer *rcd_gateway; /* reference to gateway */ struct lnet_peer *rcd_gateway; /* reference to gateway */
lnet_ping_info_t *rcd_pinginfo; /* ping buffer */ struct lnet_ping_info *rcd_pinginfo; /* ping buffer */
} lnet_rc_data_t; } lnet_rc_data_t;
typedef struct lnet_peer { typedef struct lnet_peer {
...@@ -599,7 +599,7 @@ typedef struct { ...@@ -599,7 +599,7 @@ typedef struct {
lnet_handle_md_t ln_ping_target_md; lnet_handle_md_t ln_ping_target_md;
lnet_handle_eq_t ln_ping_target_eq; lnet_handle_eq_t ln_ping_target_eq;
lnet_ping_info_t *ln_ping_info; struct lnet_ping_info *ln_ping_info;
/* router checker startup/shutdown state */ /* router checker startup/shutdown state */
int ln_rc_state; int ln_rc_state;
......
...@@ -242,13 +242,13 @@ typedef struct { ...@@ -242,13 +242,13 @@ typedef struct {
__u32 ns_unused; __u32 ns_unused;
} WIRE_ATTR lnet_ni_status_t; } WIRE_ATTR lnet_ni_status_t;
typedef struct { struct lnet_ping_info {
__u32 pi_magic; __u32 pi_magic;
__u32 pi_features; __u32 pi_features;
lnet_pid_t pi_pid; lnet_pid_t pi_pid;
__u32 pi_nnis; __u32 pi_nnis;
lnet_ni_status_t pi_ni[0]; lnet_ni_status_t pi_ni[0];
} WIRE_ATTR lnet_ping_info_t; } WIRE_ATTR;
typedef struct lnet_counters { typedef struct lnet_counters {
__u32 msgs_alloc; __u32 msgs_alloc;
......
...@@ -822,13 +822,13 @@ lnet_count_acceptor_nis(void) ...@@ -822,13 +822,13 @@ lnet_count_acceptor_nis(void)
return count; return count;
} }
static lnet_ping_info_t * static struct lnet_ping_info *
lnet_ping_info_create(int num_ni) lnet_ping_info_create(int num_ni)
{ {
lnet_ping_info_t *ping_info; struct lnet_ping_info *ping_info;
unsigned int infosz; unsigned int infosz;
infosz = offsetof(lnet_ping_info_t, pi_ni[num_ni]); infosz = offsetof(struct lnet_ping_info, pi_ni[num_ni]);
LIBCFS_ALLOC(ping_info, infosz); LIBCFS_ALLOC(ping_info, infosz);
if (!ping_info) { if (!ping_info) {
CERROR("Can't allocate ping info[%d]\n", num_ni); CERROR("Can't allocate ping info[%d]\n", num_ni);
...@@ -860,10 +860,10 @@ lnet_get_ni_count(void) ...@@ -860,10 +860,10 @@ lnet_get_ni_count(void)
} }
static inline void static inline void
lnet_ping_info_free(lnet_ping_info_t *pinfo) lnet_ping_info_free(struct lnet_ping_info *pinfo)
{ {
LIBCFS_FREE(pinfo, LIBCFS_FREE(pinfo,
offsetof(lnet_ping_info_t, offsetof(struct lnet_ping_info,
pi_ni[pinfo->pi_nnis])); pi_ni[pinfo->pi_nnis]));
} }
...@@ -889,14 +889,14 @@ lnet_ping_info_destroy(void) ...@@ -889,14 +889,14 @@ lnet_ping_info_destroy(void)
static void static void
lnet_ping_event_handler(lnet_event_t *event) lnet_ping_event_handler(lnet_event_t *event)
{ {
lnet_ping_info_t *pinfo = event->md.user_ptr; struct lnet_ping_info *pinfo = event->md.user_ptr;
if (event->unlinked) if (event->unlinked)
pinfo->pi_features = LNET_PING_FEAT_INVAL; pinfo->pi_features = LNET_PING_FEAT_INVAL;
} }
static int static int
lnet_ping_info_setup(lnet_ping_info_t **ppinfo, lnet_handle_md_t *md_handle, lnet_ping_info_setup(struct lnet_ping_info **ppinfo, lnet_handle_md_t *md_handle,
int ni_count, bool set_eq) int ni_count, bool set_eq)
{ {
lnet_process_id_t id = {LNET_NID_ANY, LNET_PID_ANY}; lnet_process_id_t id = {LNET_NID_ANY, LNET_PID_ANY};
...@@ -930,7 +930,7 @@ lnet_ping_info_setup(lnet_ping_info_t **ppinfo, lnet_handle_md_t *md_handle, ...@@ -930,7 +930,7 @@ lnet_ping_info_setup(lnet_ping_info_t **ppinfo, lnet_handle_md_t *md_handle,
/* initialize md content */ /* initialize md content */
md.start = *ppinfo; md.start = *ppinfo;
md.length = offsetof(lnet_ping_info_t, md.length = offsetof(struct lnet_ping_info,
pi_ni[(*ppinfo)->pi_nnis]); pi_ni[(*ppinfo)->pi_nnis]);
md.threshold = LNET_MD_THRESH_INF; md.threshold = LNET_MD_THRESH_INF;
md.max_size = 0; md.max_size = 0;
...@@ -961,7 +961,7 @@ lnet_ping_info_setup(lnet_ping_info_t **ppinfo, lnet_handle_md_t *md_handle, ...@@ -961,7 +961,7 @@ lnet_ping_info_setup(lnet_ping_info_t **ppinfo, lnet_handle_md_t *md_handle,
} }
static void static void
lnet_ping_md_unlink(lnet_ping_info_t *pinfo, lnet_handle_md_t *md_handle) lnet_ping_md_unlink(struct lnet_ping_info *pinfo, lnet_handle_md_t *md_handle)
{ {
sigset_t blocked = cfs_block_allsigs(); sigset_t blocked = cfs_block_allsigs();
...@@ -979,7 +979,7 @@ lnet_ping_md_unlink(lnet_ping_info_t *pinfo, lnet_handle_md_t *md_handle) ...@@ -979,7 +979,7 @@ lnet_ping_md_unlink(lnet_ping_info_t *pinfo, lnet_handle_md_t *md_handle)
} }
static void static void
lnet_ping_info_install_locked(lnet_ping_info_t *ping_info) lnet_ping_info_install_locked(struct lnet_ping_info *ping_info)
{ {
lnet_ni_status_t *ns; lnet_ni_status_t *ns;
lnet_ni_t *ni; lnet_ni_t *ni;
...@@ -1003,9 +1003,9 @@ lnet_ping_info_install_locked(lnet_ping_info_t *ping_info) ...@@ -1003,9 +1003,9 @@ lnet_ping_info_install_locked(lnet_ping_info_t *ping_info)
} }
static void static void
lnet_ping_target_update(lnet_ping_info_t *pinfo, lnet_handle_md_t md_handle) lnet_ping_target_update(struct lnet_ping_info *pinfo, lnet_handle_md_t md_handle)
{ {
lnet_ping_info_t *old_pinfo = NULL; struct lnet_ping_info *old_pinfo = NULL;
lnet_handle_md_t old_md; lnet_handle_md_t old_md;
/* switch the NIs to point to the new ping info created */ /* switch the NIs to point to the new ping info created */
...@@ -1496,7 +1496,7 @@ LNetNIInit(lnet_pid_t requested_pid) ...@@ -1496,7 +1496,7 @@ LNetNIInit(lnet_pid_t requested_pid)
int im_a_router = 0; int im_a_router = 0;
int rc; int rc;
int ni_count; int ni_count;
lnet_ping_info_t *pinfo; struct lnet_ping_info *pinfo;
lnet_handle_md_t md_handle; lnet_handle_md_t md_handle;
struct list_head net_head; struct list_head net_head;
...@@ -1754,7 +1754,7 @@ int ...@@ -1754,7 +1754,7 @@ int
lnet_dyn_add_ni(lnet_pid_t requested_pid, struct lnet_ioctl_config_data *conf) lnet_dyn_add_ni(lnet_pid_t requested_pid, struct lnet_ioctl_config_data *conf)
{ {
char *nets = conf->cfg_config_u.cfg_net.net_intf; char *nets = conf->cfg_config_u.cfg_net.net_intf;
lnet_ping_info_t *pinfo; struct lnet_ping_info *pinfo;
lnet_handle_md_t md_handle; lnet_handle_md_t md_handle;
struct lnet_ni *ni; struct lnet_ni *ni;
struct list_head net_head; struct list_head net_head;
...@@ -1834,7 +1834,7 @@ int ...@@ -1834,7 +1834,7 @@ int
lnet_dyn_del_ni(__u32 net) lnet_dyn_del_ni(__u32 net)
{ {
lnet_ni_t *ni; lnet_ni_t *ni;
lnet_ping_info_t *pinfo; struct lnet_ping_info *pinfo;
lnet_handle_md_t md_handle; lnet_handle_md_t md_handle;
int rc; int rc;
...@@ -2147,7 +2147,7 @@ static int lnet_ping(lnet_process_id_t id, int timeout_ms, ...@@ -2147,7 +2147,7 @@ static int lnet_ping(lnet_process_id_t id, int timeout_ms,
int replied = 0; int replied = 0;
const int a_long_time = 60000; /* mS */ const int a_long_time = 60000; /* mS */
int infosz; int infosz;
lnet_ping_info_t *info; struct lnet_ping_info *info;
lnet_process_id_t tmpid; lnet_process_id_t tmpid;
int i; int i;
int nob; int nob;
...@@ -2155,7 +2155,7 @@ static int lnet_ping(lnet_process_id_t id, int timeout_ms, ...@@ -2155,7 +2155,7 @@ static int lnet_ping(lnet_process_id_t id, int timeout_ms,
int rc2; int rc2;
sigset_t blocked; sigset_t blocked;
infosz = offsetof(lnet_ping_info_t, pi_ni[n_ids]); infosz = offsetof(struct lnet_ping_info, pi_ni[n_ids]);
if (n_ids <= 0 || if (n_ids <= 0 ||
id.nid == LNET_NID_ANY || id.nid == LNET_NID_ANY ||
...@@ -2283,18 +2283,18 @@ static int lnet_ping(lnet_process_id_t id, int timeout_ms, ...@@ -2283,18 +2283,18 @@ static int lnet_ping(lnet_process_id_t id, int timeout_ms,
goto out_1; goto out_1;
} }
if (nob < offsetof(lnet_ping_info_t, pi_ni[0])) { if (nob < offsetof(struct lnet_ping_info, pi_ni[0])) {
CERROR("%s: Short reply %d(%d min)\n", libcfs_id2str(id), CERROR("%s: Short reply %d(%d min)\n", libcfs_id2str(id),
nob, (int)offsetof(lnet_ping_info_t, pi_ni[0])); nob, (int)offsetof(struct lnet_ping_info, pi_ni[0]));
goto out_1; goto out_1;
} }
if (info->pi_nnis < n_ids) if (info->pi_nnis < n_ids)
n_ids = info->pi_nnis; n_ids = info->pi_nnis;
if (nob < offsetof(lnet_ping_info_t, pi_ni[n_ids])) { if (nob < offsetof(struct lnet_ping_info, pi_ni[n_ids])) {
CERROR("%s: Short reply %d(%d expected)\n", libcfs_id2str(id), CERROR("%s: Short reply %d(%d expected)\n", libcfs_id2str(id),
nob, (int)offsetof(lnet_ping_info_t, pi_ni[n_ids])); nob, (int)offsetof(struct lnet_ping_info, pi_ni[n_ids]));
goto out_1; goto out_1;
} }
......
...@@ -621,7 +621,7 @@ lnet_get_route(int idx, __u32 *net, __u32 *hops, ...@@ -621,7 +621,7 @@ lnet_get_route(int idx, __u32 *net, __u32 *hops,
} }
void void
lnet_swap_pinginfo(lnet_ping_info_t *info) lnet_swap_pinginfo(struct lnet_ping_info *info)
{ {
int i; int i;
lnet_ni_status_t *stat; lnet_ni_status_t *stat;
...@@ -644,7 +644,7 @@ lnet_swap_pinginfo(lnet_ping_info_t *info) ...@@ -644,7 +644,7 @@ lnet_swap_pinginfo(lnet_ping_info_t *info)
static void static void
lnet_parse_rc_info(lnet_rc_data_t *rcd) lnet_parse_rc_info(lnet_rc_data_t *rcd)
{ {
lnet_ping_info_t *info = rcd->rcd_pinginfo; struct lnet_ping_info *info = rcd->rcd_pinginfo;
struct lnet_peer *gw = rcd->rcd_gateway; struct lnet_peer *gw = rcd->rcd_gateway;
lnet_route_t *rte; lnet_route_t *rte;
...@@ -902,7 +902,7 @@ static lnet_rc_data_t * ...@@ -902,7 +902,7 @@ static lnet_rc_data_t *
lnet_create_rc_data_locked(lnet_peer_t *gateway) lnet_create_rc_data_locked(lnet_peer_t *gateway)
{ {
lnet_rc_data_t *rcd = NULL; lnet_rc_data_t *rcd = NULL;
lnet_ping_info_t *pi; struct lnet_ping_info *pi;
lnet_md_t md; lnet_md_t md;
int rc; int rc;
int i; int i;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment