Whamcloud - gitweb
LU-9480 lnet: add msg_type to lnet_event 85/25785/23
authorOlaf Weber <olaf@sgi.com>
Fri, 27 Jan 2017 15:31:57 +0000 (16:31 +0100)
committerAmir Shehata <amir.shehata@intel.com>
Tue, 22 Aug 2017 16:25:25 +0000 (16:25 +0000)
Add a msg_type field to the lnet_event structure. This makes
it possible for an event handler to tell whether LNET_EVENT_SEND
corresponds to a GET or a PUT message.

Test-Parameters: trivial
Signed-off-by: Olaf Weber <olaf@sgi.com>
Change-Id: If9ecc42c26eb078c19697f399a17f80b2e225639
Reviewed-on: https://review.whamcloud.com/25785
Reviewed-by: Amir Shehata <amir.shehata@intel.com>
Tested-by: Amir Shehata <amir.shehata@intel.com>
lnet/include/uapi/linux/lnet/lnet-types.h
lnet/lnet/lib-msg.c

index a80cc73..4d4c649 100644 (file)
@@ -658,6 +658,11 @@ typedef struct lnet_event {
         */
        __u64               hdr_data;
        /**
+        * The message type, to ensure a handler for LNET_EVENT_SEND can
+        * distinguish between LNET_MSG_GET and LNET_MSG_PUT.
+        */
+       __u32               msg_type;
+       /**
         * Indicates the completion status of the operation. It's 0 for
         * successful operations, otherwise it's an error code.
         */
index 1b90855..736bea1 100644 (file)
@@ -65,6 +65,7 @@ lnet_build_msg_event(struct lnet_msg *msg, enum lnet_event_kind ev_type)
        LASSERT(!msg->msg_routing);
 
        ev->type = ev_type;
+       ev->msg_type = msg->msg_type;
 
        if (ev_type == LNET_EVENT_SEND) {
                /* event for active message */
@@ -75,7 +76,6 @@ lnet_build_msg_event(struct lnet_msg *msg, enum lnet_event_kind ev_type)
                ev->source.nid    = LNET_NID_ANY;
                ev->source.pid    = the_lnet.ln_pid;
                ev->sender        = LNET_NID_ANY;
-
        } else {
                /* event for passive message */
                ev->target.pid    = hdr->dest_pid;