unsigned int nsiov, lnet_kiov_t *siov, unsigned int soffset,
unsigned int nob)
{
- /* NB diov, siov are READ-ONLY */
- unsigned int this_nob;
- char *daddr = NULL;
- char *saddr = NULL;
+ /* NB diov, siov are READ-ONLY */
+ unsigned int this_nob;
+ char *daddr = NULL;
+ char *saddr = NULL;
- if (nob == 0)
- return;
+ if (nob == 0)
+ return;
- LASSERT (!cfs_in_interrupt ());
+ LASSERT (!in_interrupt ());
- LASSERT (ndiov > 0);
+ LASSERT (ndiov > 0);
while (doffset >= diov->kiov_len) {
doffset -= diov->kiov_len;
diov++;
unsigned int nkiov, lnet_kiov_t *kiov, unsigned int kiovoffset,
unsigned int nob)
{
- /* NB iov, kiov are READ-ONLY */
- unsigned int this_nob;
- char *addr = NULL;
+ /* NB iov, kiov are READ-ONLY */
+ unsigned int this_nob;
+ char *addr = NULL;
- if (nob == 0)
- return;
+ if (nob == 0)
+ return;
- LASSERT (!cfs_in_interrupt ());
+ LASSERT (!in_interrupt ());
- LASSERT (niov > 0);
+ LASSERT (niov > 0);
while (iovoffset >= iov->iov_len) {
iovoffset -= iov->iov_len;
iov++;
unsigned int niov, struct iovec *iov, unsigned int iovoffset,
unsigned int nob)
{
- /* NB kiov, iov are READ-ONLY */
- unsigned int this_nob;
- char *addr = NULL;
+ /* NB kiov, iov are READ-ONLY */
+ unsigned int this_nob;
+ char *addr = NULL;
- if (nob == 0)
- return;
+ if (nob == 0)
+ return;
- LASSERT (!cfs_in_interrupt ());
+ LASSERT (!in_interrupt ());
- LASSERT (nkiov > 0);
+ LASSERT (nkiov > 0);
while (kiovoffset >= kiov->kiov_len) {
kiovoffset -= kiov->kiov_len;
kiov++;
lnet_ni_recv(lnet_ni_t *ni, void *private, lnet_msg_t *msg, int delayed,
unsigned int offset, unsigned int mlen, unsigned int rlen)
{
- unsigned int niov = 0;
- struct iovec *iov = NULL;
- lnet_kiov_t *kiov = NULL;
- int rc;
+ unsigned int niov = 0;
+ struct iovec *iov = NULL;
+ lnet_kiov_t *kiov = NULL;
+ int rc;
- LASSERT (!cfs_in_interrupt ());
- LASSERT (mlen == 0 || msg != NULL);
+ LASSERT (!in_interrupt ());
+ LASSERT (mlen == 0 || msg != NULL);
if (msg != NULL) {
LASSERT(msg->msg_receiving);
void
lnet_ni_send(lnet_ni_t *ni, lnet_msg_t *msg)
{
- void *priv = msg->msg_private;
- int rc;
+ void *priv = msg->msg_private;
+ int rc;
- LASSERT (!cfs_in_interrupt ());
- LASSERT (LNET_NETTYP(LNET_NIDNET(ni->ni_nid)) == LOLND ||
- (msg->msg_txcredit && msg->msg_peertxcredit));
+ LASSERT (!in_interrupt ());
+ LASSERT (LNET_NETTYP(LNET_NIDNET(ni->ni_nid)) == LOLND ||
+ (msg->msg_txcredit && msg->msg_peertxcredit));
- rc = (ni->ni_lnd->lnd_send)(ni, priv, msg);
- if (rc < 0)
- lnet_finalize(ni, msg, rc);
+ rc = (ni->ni_lnd->lnd_send)(ni, priv, msg);
+ if (rc < 0)
+ lnet_finalize(ni, msg, rc);
}
int
lnet_find_route_locked(lnet_ni_t *ni, lnet_nid_t target, lnet_nid_t rtr_nid)
{
lnet_remotenet_t *rnet;
- lnet_route_t *rtr;
- lnet_route_t *rtr_best;
- lnet_route_t *rtr_last;
+ lnet_route_t *route;
+ lnet_route_t *best_route;
+ lnet_route_t *last_route;
struct lnet_peer *lp_best;
struct lnet_peer *lp;
int rc;
return NULL;
lp_best = NULL;
- rtr_best = rtr_last = NULL;
- cfs_list_for_each_entry(rtr, &rnet->lrn_routes, lr_list) {
- lp = rtr->lr_gateway;
+ best_route = last_route = NULL;
+ cfs_list_for_each_entry(route, &rnet->lrn_routes, lr_list) {
+ lp = route->lr_gateway;
- if (!lp->lp_alive || /* gateway is down */
- ((lp->lp_ping_feats & LNET_PING_FEAT_NI_STATUS) != 0 &&
- rtr->lr_downis != 0)) /* NI to target is down */
+ if (!lnet_is_route_alive(route))
continue;
if (ni != NULL && lp->lp_ni != ni)
return lp;
if (lp_best == NULL) {
- rtr_best = rtr_last = rtr;
+ best_route = last_route = route;
lp_best = lp;
continue;
}
/* no protection on below fields, but it's harmless */
- if (rtr_last->lr_seq - rtr->lr_seq < 0)
- rtr_last = rtr;
+ if (last_route->lr_seq - route->lr_seq < 0)
+ last_route = route;
- rc = lnet_compare_routes(rtr, rtr_best);
+ rc = lnet_compare_routes(route, best_route);
if (rc < 0)
continue;
- rtr_best = rtr;
+ best_route = route;
lp_best = lp;
}
/* set sequence number on the best router to the latest sequence + 1
* so we can round-robin all routers, it's race and inaccurate but
* harmless and functional */
- if (rtr_best != NULL)
- rtr_best->lr_seq = rtr_last->lr_seq + 1;
+ if (best_route != NULL)
+ best_route->lr_seq = last_route->lr_seq + 1;
return lp_best;
}
struct lnet_msg *msg;
lnet_pid_t dest_pid;
lnet_nid_t dest_nid;
- lnet_nid_t src_nid;
- __u32 payload_length;
- __u32 type;
+ lnet_nid_t src_nid;
+ __u32 payload_length;
+ __u32 type;
- LASSERT (!cfs_in_interrupt ());
+ LASSERT (!in_interrupt ());
- type = le32_to_cpu(hdr->type);
- src_nid = le64_to_cpu(hdr->src_nid);
- dest_nid = le64_to_cpu(hdr->dest_nid);
- dest_pid = le32_to_cpu(hdr->dest_pid);
+ type = le32_to_cpu(hdr->type);
+ src_nid = le64_to_cpu(hdr->src_nid);
+ dest_nid = le64_to_cpu(hdr->dest_nid);
+ dest_pid = le32_to_cpu(hdr->dest_pid);
payload_length = le32_to_cpu(hdr->payload_length);
for_me = (ni->ni_nid == dest_nid);