diff mbox series

[15/24] lustre: lnet: add msg_type to lnet_event

Message ID 153895437812.16383.7373974293282162856.stgit@noble (mailing list archive)
State New, archived
Headers show
Series Port Dynamic Discovery to drivers/staging | expand

Commit Message

NeilBrown Oct. 7, 2018, 11:19 p.m. UTC
From: Olaf Weber <olaf@sgi.com>

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.

WC-bug-id: https://jira.whamcloud.com/browse/LU-9480
Signed-off-by: Olaf Weber <olaf@sgi.com>
Reviewed-on: https://review.whamcloud.com/25785
Reviewed-by: Amir Shehata <amir.shehata@intel.com>
Tested-by: Amir Shehata <amir.shehata@intel.com>
Signed-off-by: NeilBrown <neilb@suse.com>
---
 .../lustre/include/uapi/linux/lnet/lnet-types.h    |    5 +++++
 drivers/staging/lustre/lnet/lnet/lib-msg.c         |    1 +
 2 files changed, 6 insertions(+)

Comments

James Simmons Oct. 14, 2018, 10:44 p.m. UTC | #1
> From: Olaf Weber <olaf@sgi.com>
> 
> 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.

Reviewed-by: James Simmons <jsimmons@infradead.org>
 
> WC-bug-id: https://jira.whamcloud.com/browse/LU-9480
> Signed-off-by: Olaf Weber <olaf@sgi.com>
> Reviewed-on: https://review.whamcloud.com/25785
> Reviewed-by: Amir Shehata <amir.shehata@intel.com>
> Tested-by: Amir Shehata <amir.shehata@intel.com>
> Signed-off-by: NeilBrown <neilb@suse.com>
> ---
>  .../lustre/include/uapi/linux/lnet/lnet-types.h    |    5 +++++
>  drivers/staging/lustre/lnet/lnet/lib-msg.c         |    1 +
>  2 files changed, 6 insertions(+)
> 
> diff --git a/drivers/staging/lustre/include/uapi/linux/lnet/lnet-types.h b/drivers/staging/lustre/include/uapi/linux/lnet/lnet-types.h
> index e0e4fd259795..1ecf18e4a278 100644
> --- a/drivers/staging/lustre/include/uapi/linux/lnet/lnet-types.h
> +++ b/drivers/staging/lustre/include/uapi/linux/lnet/lnet-types.h
> @@ -650,6 +650,11 @@ struct lnet_event {
>  	 * \see LNetPut
>  	 */
>  	__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.
> diff --git a/drivers/staging/lustre/lnet/lnet/lib-msg.c b/drivers/staging/lustre/lnet/lnet/lib-msg.c
> index 1817e54a16a5..db13d01d366f 100644
> --- a/drivers/staging/lustre/lnet/lnet/lib-msg.c
> +++ b/drivers/staging/lustre/lnet/lnet/lib-msg.c
> @@ -63,6 +63,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 */
> 
> 
>
James Simmons Oct. 14, 2018, 10:44 p.m. UTC | #2
> From: Olaf Weber <olaf@sgi.com>
> 
> 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.

Reviewed-by: James Simmons <jsimmons@infradead.org>
 
> WC-bug-id: https://jira.whamcloud.com/browse/LU-9480
> Signed-off-by: Olaf Weber <olaf@sgi.com>
> Reviewed-on: https://review.whamcloud.com/25785
> Reviewed-by: Amir Shehata <amir.shehata@intel.com>
> Tested-by: Amir Shehata <amir.shehata@intel.com>
> Signed-off-by: NeilBrown <neilb@suse.com>
> ---
>  .../lustre/include/uapi/linux/lnet/lnet-types.h    |    5 +++++
>  drivers/staging/lustre/lnet/lnet/lib-msg.c         |    1 +
>  2 files changed, 6 insertions(+)
> 
> diff --git a/drivers/staging/lustre/include/uapi/linux/lnet/lnet-types.h b/drivers/staging/lustre/include/uapi/linux/lnet/lnet-types.h
> index e0e4fd259795..1ecf18e4a278 100644
> --- a/drivers/staging/lustre/include/uapi/linux/lnet/lnet-types.h
> +++ b/drivers/staging/lustre/include/uapi/linux/lnet/lnet-types.h
> @@ -650,6 +650,11 @@ struct lnet_event {
>  	 * \see LNetPut
>  	 */
>  	__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.
> diff --git a/drivers/staging/lustre/lnet/lnet/lib-msg.c b/drivers/staging/lustre/lnet/lnet/lib-msg.c
> index 1817e54a16a5..db13d01d366f 100644
> --- a/drivers/staging/lustre/lnet/lnet/lib-msg.c
> +++ b/drivers/staging/lustre/lnet/lnet/lib-msg.c
> @@ -63,6 +63,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 */
> 
> 
>
diff mbox series

Patch

diff --git a/drivers/staging/lustre/include/uapi/linux/lnet/lnet-types.h b/drivers/staging/lustre/include/uapi/linux/lnet/lnet-types.h
index e0e4fd259795..1ecf18e4a278 100644
--- a/drivers/staging/lustre/include/uapi/linux/lnet/lnet-types.h
+++ b/drivers/staging/lustre/include/uapi/linux/lnet/lnet-types.h
@@ -650,6 +650,11 @@  struct lnet_event {
 	 * \see LNetPut
 	 */
 	__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.
diff --git a/drivers/staging/lustre/lnet/lnet/lib-msg.c b/drivers/staging/lustre/lnet/lnet/lib-msg.c
index 1817e54a16a5..db13d01d366f 100644
--- a/drivers/staging/lustre/lnet/lnet/lib-msg.c
+++ b/drivers/staging/lustre/lnet/lnet/lib-msg.c
@@ -63,6 +63,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 */