#define WIRE_ATTR __attribute__((packed))
+/* Packed version of lnet_process_id_t to transfer via network */
+#include <libcfs/libcfs_pack.h>
+typedef struct {
+ lnet_nid_t nid;
+ lnet_pid_t pid; /* node id / process id */
+} WIRE_ATTR lnet_process_id_packed_t;
+
/* The wire handle's interface cookie only matches one network interface in
* one epoch (i.e. new cookie when the interface restarts or the node
* reboots). The object cookie only matches one object on that interface
* during that object's lifetime (i.e. no cookie re-use). */
-#include <libcfs/libcfs_pack.h>
typedef struct {
__u64 wh_interface_cookie;
__u64 wh_object_cookie;
return 0;
}
-lnet_process_id_t *
+lnet_process_id_packed_t *
lstcon_next_id(int idx, int nkiov, lnet_kiov_t *kiov)
{
- lnet_process_id_t *pid;
- int i;
+ lnet_process_id_packed_t *pid;
+ int i;
- i = idx / (CFS_PAGE_SIZE / sizeof(lnet_process_id_t));
+ i = idx / SFW_ID_PER_PAGE;
LASSERT (i < nkiov);
- pid = (lnet_process_id_t *)cfs_page_address(kiov[i].kiov_page);
+ pid = (lnet_process_id_packed_t *)cfs_page_address(kiov[i].kiov_page);
- return &pid[idx % (CFS_PAGE_SIZE / sizeof(lnet_process_id_t))];
+ return &pid[idx % SFW_ID_PER_PAGE];
}
int
lstcon_dstnodes_prep(lstcon_group_t *grp, int idx,
int dist, int span, int nkiov, lnet_kiov_t *kiov)
{
- lnet_process_id_t *pid;
- lstcon_ndlink_t *ndl;
- lstcon_node_t *nd;
- int start;
- int end;
- int i = 0;
+ lnet_process_id_packed_t *pid;
+ lstcon_ndlink_t *ndl;
+ lstcon_node_t *nd;
+ int start;
+ int end;
+ int i = 0;
LASSERT (dist >= 1);
LASSERT (span >= 1);
break;
pid = lstcon_next_id((i - start), nkiov, kiov);
- *pid = nd->nd_id;
+ pid->nid = nd->nd_id.nid;
+ pid->pid = nd->nd_id.pid;
i++;
}
nd = ndl->ndl_node;
pid = lstcon_next_id((i - start), nkiov, kiov);
- *pid = nd->nd_id;
+ pid->nid = nd->nd_id.nid;
+ pid->pid = nd->nd_id.pid;
i++;
}
memcpy(&tsi->tsi_u, &req->tsr_u, sizeof(tsi->tsi_u));
for (i = 0; i < ndest; i++) {
- lnet_process_id_t *dests;
- lnet_process_id_t id;
- int j;
+ lnet_process_id_packed_t *dests;
+ lnet_process_id_packed_t id;
+ int j;
#ifdef __KERNEL__
dests = cfs_page_address(bk->bk_iovs[i / SFW_ID_PER_PAGE].kiov_page);
goto error;
}
- tsu->tsu_dest = id;
+ tsu->tsu_dest.nid = id.nid;
+ tsu->tsu_dest.pid = id.pid;
tsu->tsu_instance = tsi;
tsu->tsu_private = NULL;
cfs_list_add_tail(&tsu->tsu_list, &tsi->tsi_units);
/* XXX: trailing (CFS_PAGE_SIZE % sizeof(lnet_process_id_t)) bytes at
* the end of pages are not used */
#define SFW_MAX_CONCUR LST_MAX_CONCUR
-#define SFW_ID_PER_PAGE (CFS_PAGE_SIZE / sizeof(lnet_process_id_t))
+#define SFW_ID_PER_PAGE (CFS_PAGE_SIZE / sizeof(lnet_process_id_packed_t))
#define SFW_MAX_NDESTS (LNET_MAX_IOV * SFW_ID_PER_PAGE)
#define sfw_id_pages(n) (((n) + SFW_ID_PER_PAGE - 1) / SFW_ID_PER_PAGE)