X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lnet%2Finclude%2Flnet%2Fsocklnd.h;h=127134433fc80009fa03fbf922d806eac86b8d9e;hp=75a6b9b61f117596eaf8117104e14dee46bf9ca3;hb=c6aab2ca77831852db22b7dc39baed4d06405b7e;hpb=6869932b552ac705f411de3362f01bd50c1f6f7d diff --git a/lnet/include/lnet/socklnd.h b/lnet/include/lnet/socklnd.h index 75a6b9b..1271344 100644 --- a/lnet/include/lnet/socklnd.h +++ b/lnet/include/lnet/socklnd.h @@ -1,6 +1,4 @@ -/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*- - * vim:expandtab:shiftwidth=8:tabstop=8: - * +/* * GPL HEADER START * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -26,7 +24,7 @@ * GPL HEADER END */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. */ /* @@ -41,7 +39,6 @@ #define __LNET_LNET_SOCKLND_H__ #include -#include #define SOCKLND_CONN_NONE (-1) #define SOCKLND_CONN_ANY 0 @@ -50,6 +47,8 @@ #define SOCKLND_CONN_BULK_OUT 3 #define SOCKLND_CONN_NTYPES 4 +#define SOCKLND_CONN_ACK SOCKLND_CONN_BULK_IN + typedef struct { __u32 kshm_magic; /* magic number of socklnd message */ __u32 kshm_version; /* version of socklnd message */ @@ -66,24 +65,38 @@ typedef struct { typedef struct { lnet_hdr_t ksnm_hdr; /* lnet hdr */ - char ksnm_payload[0];/* lnet payload */ + + /* + * ksnm_payload is removed because of winnt compiler's limitation: + * zero-sized array can only be placed at the tail of [nested] + * structure definitions. lnet payload will be stored just after + * the body of structure ksock_lnet_msg_t + */ } WIRE_ATTR ksock_lnet_msg_t; typedef struct { __u32 ksm_type; /* type of socklnd message */ __u32 ksm_csum; /* checksum if != 0 */ - __u64 ksm_zc_req_cookie; /* ack required if != 0 */ - __u64 ksm_zc_ack_cookie; /* ack if != 0 */ + __u64 ksm_zc_cookies[2]; /* Zero-Copy request/ACK cookie */ union { ksock_lnet_msg_t lnetmsg; /* lnet message, it's empty if it's NOOP */ } WIRE_ATTR ksm_u; } WIRE_ATTR ksock_msg_t; -#define KSOCK_MSG_NOOP 0xc0 /* ksm_u empty */ +static inline void +socklnd_init_msg(ksock_msg_t *msg, int type) +{ + msg->ksm_csum = 0; + msg->ksm_type = type; + msg->ksm_zc_cookies[0] = msg->ksm_zc_cookies[1] = 0; +} + +#define KSOCK_MSG_NOOP 0xc0 /* ksm_u empty */ #define KSOCK_MSG_LNET 0xc1 /* lnet msg */ /* We need to know this number to parse hello msg from ksocklnd in - * other LND (usocklnd, for example) */ + * other LND (usocklnd, for example) */ #define KSOCK_PROTO_V2 2 +#define KSOCK_PROTO_V3 3 #endif