int (*pro_send_hello)(struct ksock_conn *, struct ksock_hello_msg *); /* handshake function */
int (*pro_recv_hello)(struct ksock_conn *, struct ksock_hello_msg *, int);/* handshake function */
void (*pro_pack)(struct ksock_tx *); /* message pack */
- void (*pro_unpack)(struct ksock_msg *); /* message unpack */
+ void (*pro_unpack)(struct ksock_msg *, struct lnet_hdr *); /* message unpack */
struct ksock_tx *(*pro_queue_tx_msg)(struct ksock_conn *, struct ksock_tx *); /* queue tx on the connection */
int (*pro_queue_tx_zcack)(struct ksock_conn *, struct ksock_tx *, __u64); /* queue ZC ack on the connection */
int (*pro_handle_zcreq)(struct ksock_conn *, __u64, int); /* handle ZC request */
case SOCKNAL_RX_LNET_HEADER:
/* unpack message header */
- conn->ksnc_proto->pro_unpack(&conn->ksnc_msg);
-
- lnet_hdr_from_nid4(&hdr, &conn->ksnc_msg.ksm_u.lnetmsg_nid4);
+ conn->ksnc_proto->pro_unpack(&conn->ksnc_msg, &hdr);
if ((conn->ksnc_peer->ksnp_id.pid & LNET_PID_USERFLAG) != 0) {
/* Userspace peer_ni */
}
static void
-ksocknal_unpack_msg_v1(struct ksock_msg *msg)
+ksocknal_unpack_msg_v1(struct ksock_msg *msg, struct lnet_hdr *hdr)
{
msg->ksm_csum = 0;
msg->ksm_type = KSOCK_MSG_LNET;
msg->ksm_zc_cookies[0] = msg->ksm_zc_cookies[1] = 0;
+ lnet_hdr_from_nid4(hdr, &msg->ksm_u.lnetmsg_nid4);
}
static void
-ksocknal_unpack_msg_v2(struct ksock_msg *msg)
+ksocknal_unpack_msg_v2(struct ksock_msg *msg, struct lnet_hdr *hdr)
{
- return; /* Do nothing */
+ lnet_hdr_from_nid4(hdr, &msg->ksm_u.lnetmsg_nid4);
}
const struct ksock_proto ksocknal_protocol_v1x =